import java . util . * ;   public class Main {   public static void main ( String [ ] args ) {   Scanner sc = new Scanner ( System . in ) ;   String s1 = sc . next ( ) ; char [ ] a = s1 . toCharArray ( ) ; int len = a . length ;   HashSet < Character > set = new HashSet < Character > ( ) ; int count = 0 ; for ( int i = 0 ; i < len ; i ++ ) { if ( ! set . contains ( a [ i ] ) ) { set . add ( a [ i ] ) ; count ++ ; } }

s = list ( input ( ) ) d = set ( s ) if len ( d ) % 2 != 0 : print ( ' IGNORE ▁ HIM ! ' ) else : print ( " CHAT ▁ WITH ▁ HER ! " ) NEW_LINE


print ( [ " CHAT ▁ WITH ▁ HER ! " , " IGNORE ▁ HIM ! " ] [ len ( { * input ( ) } ) % 2 ] ) NEW_LINE


s = input ( ) n = len ( set ( list ( s ) ) )   if ( n % 2 == 0 ) : print ( " CHAT ▁ WITH ▁ HER ! " ) else : print ( " IGNORE ▁ HIM ! " ) NEW_LINE


import java . util . Scanner ;   public class Main { public static void main ( String [ ] args ) { Scanner read = new Scanner ( System . in ) ; String username = read . nextLine ( ) ; String distinctCharacters = " " ; for ( int i = 0 ; i < username . length ( ) ; i ++ ) { char current = username . charAt ( i ) ; if ( distinctCharacters . indexOf ( current ) < 0 ) distinctCharacters += current ; } if ( distinctCharacters . length ( ) % 2 == 0 ) { System . out . println ( " CHAT ▁ WITH ▁ HER ! " ) ; } else { System . out . println ( " IGNORE ▁ HIM ! " ) ; } read . close ( ) ; } }


import java . io . * ; import java . lang . * ; import java . util . * ;    public class Main {   static Main . MyScanner sc = new Main . MyScanner ( ) ; static PrintStream out = System . out ;   public static void main ( String [ ] args ) throws Exception { String input = sc . next ( ) ; if ( uniqueChar ( input ) . length ( ) % 2 == 0 ) out . print ( " CHAT ▁ WITH ▁ HER ! " ) ; else out . print ( " IGNORE ▁ HIM ! " ) ; out . close ( ) ; } public static String uniqueChar ( String input ) { String temp = " " ; for ( int i = 0 ; i < input . length ( ) ; i ++ ) { if ( temp . indexOf ( input . charAt ( i ) ) == - 1 ) temp += input . charAt ( i ) ; } return temp ; } static private class MyScanner { BufferedReader br ; StringTokenizer st ;   public MyScanner ( ) { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; }   public long mod ( long x ) {


import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . HashSet ; import java . util . StringTokenizer ; import java . io . IOException ; import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . io . InputStream ;   public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; FastScanner in = new FastScanner ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; ABoyOrGirl solver = new ABoyOrGirl ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; }   static class ABoyOrGirl { public void solve ( int testNumber , FastScanner fs , PrintWriter out ) { String s = fs . next ( ) ; HashSet < Character > chars = new HashSet < > ( ) ;   for ( int i = 0 ; i < s . length ( ) ; i ++ ) { chars . add ( s . charAt ( i ) ) ; }   out . println ( chars . size ( ) % 2 == 1 ? " IGNORE ▁ HIM ! " : " CHAT ▁ WITH ▁ HER ! " ) ; }   }   static class FastScanner { BufferedReader br ; StringTokenizer st ;   public FastScanner ( InputStream inputStream ) { br = new BufferedReader ( new InputStreamReader ( inputStream ) ) ; }   public String next ( ) { while ( st == null || ! st . hasMoreElements ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; }   } }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . HashSet ; import java . util . StringTokenizer ;   public class A_Boy_or_Girl { public static void main ( String [ ] args ) { FastScanner fs = new FastScanner ( ) ; char [ ] s = fs . next ( ) . toCharArray ( ) ; HashSet < Character > dist = new HashSet < > ( ) ;   for ( char c : s ) { dist . add ( c ) ; }   if ( dist . size ( ) % 2 == 0 ) { System . out . println ( " CHAT ▁ WITH ▁ HER ! " ) ; } else { System . out . println ( " IGNORE ▁ HIM ! " ) ; } }   static int min ( int a , int b ) { return Math . min ( a , b ) ; }   static int max ( int a , int b ) { return Math . max ( a , b ) ; }   static long min ( long a , long b ) { return Math . min ( a , b ) ; }   static long max ( long a , long b ) { return Math . max ( a , b ) ; }   static class FastScanner { BufferedReader br ; StringTokenizer st ;   public FastScanner ( ) { 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 ( ) ) ; } char nextChar ( ) { return next ( ) . charAt ( 0 ) ; }   String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; } } }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Arrays ; import java . util . StringTokenizer ;   public class test { public static void main ( String ... args ) throws NumberFormatException , IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int t = Integer . parseInt ( br . readLine ( ) ) ; for ( int i = 0 ; i < t ; i ++ ) { long n = Long . parseLong ( br . readLine ( ) ) ; int j = 0 ; int count = 0 ; while ( j < 64 ) { if ( ( ( n >> j ) & 1 ) == 1 ) { count ++ ; } j ++ ; } System . out . println ( ( long ) Math . pow ( 2 , count ) ) ; } } }

n = int ( input ( " " ) ) l = [ ] for k in range ( n ) : b = int ( input ( " " ) ) l . append ( b ) final = [ ] for i in l : c = 0 while i > 0 : if i % 2 == 1 : c = c + 1 i = int ( i / 2 ) final . append ( c ) for j in final : print ( 2 ** j ) NEW_LINE


t = int ( input ( ) )   while t : print ( 2 ** bin ( int ( input ( ) ) ) . count ( '1' ) ) t -= 1 NEW_LINE


import sys , collections , math , itertools , random , bisectINF = sys . maxsizedef get_ints ( ) : return map ( int , sys . stdin . readline ( ) . strip ( ) . split ( ) ) def get_array ( ) : return list ( map ( int , sys . stdin . readline ( ) . strip ( ) . split ( ) ) ) def input ( ) : return sys . stdin . readline ( ) . strip ( ) mod = 1000000007   for _ in range ( int ( input ( ) ) ) : a = int ( input ( ) ) print ( 1 << ( bin ( a ) [ 2 : ] . count ( '1' ) ) ) NEW_LINE


t = int ( input ( ) ) for _ in range ( t ) : n = int ( input ( ) ) a = 0 for i in range ( 30 ) : if n & 1 << i : a += 1 print ( 2 ** a ) NEW_LINE


t = int ( input ( ) ) for i in range ( t ) : a = int ( input ( ) ) b = format ( a , ' b ' ) 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 Main {   static String [ ] str = new String [ 3 ] ; static boolean flag ; public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; for ( int i = 0 ; i < 3 ; i ++ ) { str [ i ] = in . next ( ) ; } fun ( str [ 0 ] , str [ 1 ] , str [ 2 ] , " F " ) ; fun ( str [ 1 ] , str [ 0 ] , str [ 2 ] , " M " ) ; fun ( str [ 2 ] , str [ 1 ] , str [ 0 ] , " S " ) ; if ( flag == false ) { System . out . println ( " ? " ) ; }   in . close ( ) ; }   private static void fun ( String a , String b , String c , String res ) { if ( a . equals ( " rock " ) ) { if ( b . equals ( " scissors " ) && c . equals ( " scissors " ) ) { System . out . println ( res ) ; flag = true ; } } if ( a . equals ( " paper " ) ) { if ( b . equals ( " rock " ) && c . equals ( " rock " ) ) { System . out . println ( res ) ; flag = true ; } } if ( a . equals ( " scissors " ) ) { if ( b . equals ( " paper " ) && c . equals ( " paper " ) ) { System . out . println ( res ) ; flag = true ; } } } }

f = input ( ) m = input ( ) s = input ( ) r1 = 0 r2 = 0 r3 = 0 r4 = 0 r5 = 0 r6 = 0 r7 = 0 r8 = 0 r9 = 0 r10 = 0 r11 = 0 r12 = 0 r13 = 0 r14 = 0 r15 = 0 r16 = 0 r17 = 0 r18 = 0 r19 = 0 r20 = 0 r21 = 0 r22 = 0 r23 = 0 r24 = 0 r25 = 0 r26 = 0 r27 = 0 def p ( fi , mi , si ) : person = { ' first ' : fi , ' second ' : mi , ' third ' : si } return ( person ) y = p ( f , m , s ) for k , j in y . items ( ) : if k == ' first ' : if j == ' rock ' : r1 = r1 + 1 if k == ' second ' : if j == ' rock ' : r1 = r1 + 1 if k == ' third ' : if j == ' rock ' : r1 = r1 + 1 if r1 == 3 : print ( ' ? ' )     for k , j in y . items ( ) : if k == ' first ' : if j == ' paper ' : r15 = r15 + 1 if k == ' second ' : if j == ' paper ' : r15 = r15 + 1 if k == ' third ' : if j == ' rock ' : r15 = r15 + 1 if r15 == 3 : print ( ' ? ' )   for k , j in y . items ( ) : if k == ' first ' : if j == ' paper ' : r3 = r3 + 1 if k == ' second ' : if j == ' rock ' : r3 = r3 + 1 if k == ' third ' : if j == ' rock ' : r3 = r3 + 1 if r3 == 3 : print ( ' F ' ) NEW_LINE


f = " " m = " " s = " "   paper = " paper " rock = " rock " scissors = " scissors "   def compare ( f , s , m ) : if f == s and s == m : return " ? " NEW_LINE


f = input ( ) . lower ( ) m = input ( ) . lower ( ) s = input ( ) . lower ( ) if ( f == " rock " and m == " scissors " and s == " scissors " ) or ( f == " paper " and m == " rock " and s == " rock " ) or ( f == " scissors " and m == " paper " and s == " paper " ) : print ( " F " ) elif ( m == " rock " and f == " scissors " and s == " scissors " ) or ( m == " paper " and f == " rock " and s == " rock " ) or ( m == " scissors " and f == " paper " and s == " paper " ) : print ( " M " ) elif ( s == " rock " and m == " scissors " and f == " scissors " ) or ( s == " paper " and m == " rock " and f == " rock " ) or ( s == " scissors " and m == " paper " and f == " paper " ) : print ( " S " ) else : print ( " ? " ) NEW_LINE


manos = [ input ( ) , input ( ) , input ( ) ]   indice_ganador = Nonejugadores = [ ' F ' , ' M ' , ' S ' ] NEW_LINE


if __name__ == " _ _ main _ _ " : t = 3 info = [ ] R = 0 P = 0 S = 0 while t : x = input ( ) if x == ' rock ' : R = R + 1 elif x == " scissors " : S = S + 1 else : P = P + 1 info . append ( x ) t -= 1 d = { info [ 0 ] : ' F ' , info [ 1 ] : ' M ' , info [ 2 ] : ' S ' } if ( R == 1 and S == 1 and P == 1 ) or ( R == 3 or S == 3 or P == 3 ) : print ( ' ? ' ) else : if R == 1 and S == 2 : print ( d [ ' rock ' ] ) elif S == 1 and P == 2 : print ( d [ ' scissors ' ] ) elif P == 1 and R == 2 : print ( d [ ' paper ' ] ) else : print ( " ? " )                                   NEW_LINE


import java . util . Scanner ;    public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; String [ ] s = new String [ 3 ] ; int [ ] flag = new int [ 3 ] ; for ( int i = 0 ; i < 3 ; i ++ ) { s [ i ] = sc . next ( ) ; if ( s [ i ] . equals ( " rock " ) ) flag [ i ] = 1 ; if ( s [ i ] . equals ( " scissors " ) ) flag [ i ] = 10 ; if ( s [ i ] . equals ( " paper " ) ) flag [ i ] = 100 ; } if ( flag [ 0 ] != flag [ 1 ] && flag [ 1 ] != flag [ 2 ] && flag [ 0 ] != flag [ 2 ] ) { System . out . println ( " ? " ) ; System . exit ( 0 ) ; } if ( flag [ 0 ] == flag [ 1 ] && flag [ 1 ] == flag [ 2 ] && flag [ 0 ] == flag [ 2 ] ) { System . out . println ( " ? " ) ; System . exit ( 0 ) ; } int ans = flag [ 0 ] + flag [ 1 ] + flag [ 2 ] ; if ( ans == 21 ) { int a = find ( 1 , flag ) ; print ( a ) ; } if ( ans == 210 ) { int a = find ( 10 , flag ) ; print ( a ) ; } if ( ans == 102 ) { int a = find ( 100 , flag ) ; print ( a ) ; } if ( ans == 12 || ans == 120 || ans == 201 ) System . out . println ( " ? " ) ; }   private static void print ( int a ) {


import java . util . * ;   public class Main { public static void main ( String [ ] args ) {   Scanner scanner = new Scanner ( System . in ) ;    String F = scanner . nextLine ( ) , M = scanner . nextLine ( ) , S = scanner . nextLine ( ) ;   if ( beats ( F , M ) && beats ( F , S ) ) System . out . println ( " F " ) ; else if ( beats ( M , S ) && beats ( M , F ) ) System . out . println ( " M " ) ; else if ( beats ( S , F ) && beats ( S , M ) ) System . out . println ( " S " ) ; else System . out . println ( " ? " ) ;   scanner . close ( ) ; } static boolean beats ( String s , String s2 ) { if ( s . equals ( " rock " ) && s2 . equals ( " scissors " ) ) return true ; else if ( s . equals ( " scissors " ) && s2 . equals ( " paper " ) ) return true ; else if ( s . equals ( " paper " ) && s2 . equals ( " rock " ) ) return true ; else return false ; } }


import java . util . Scanner ;   public class main {   public static void main ( String args [ ] ) { Scanner scan = new Scanner ( System . in ) ; int [ ] players = new int [ 3 ] ; for ( int i = 0 ; i < 3 ; i ++ ) { String s = scan . next ( ) ; switch ( s ) { case " rock " : players [ i ] = 1 ; break ; case " paper " : players [ i ] = 2 ; break ; case " scissors " : players [ i ] = 3 ; break ; } } int winner = check ( players ) ; if ( winner == 3 ) { System . out . println ( " ? " ) ; } else if ( winner == 0 ) { System . out . println ( " F " ) ; } else if ( winner == 1 ) { System . out . println ( " M " ) ; } else { System . out . println ( " S " ) ; }    }   public static int check ( int [ ] players ) { for ( int i = 0 ; i < 3 ; i ++ ) { if ( winAll ( players [ i ] , players ) ) { return i ; } } return 3 ; }   public static boolean winAll ( int a , int [ ] others ) { int count = 0 ; for ( int i = 0 ; i < 3 ; i ++ ) { if ( isWin ( a , others [ i ] ) ) { count ++ ; } }   return count == 2 ; }   public static boolean isWin ( int a , int b ) { if ( a == 1 && b == 3 ) { return true ; } else if ( a == 2 && b == 1 ) { return true ; } else if ( a == 3 && b == 2 ) { return true ; } else { return false ; } } }


import java . util . Scanner ;   public class Main {   static boolean flag ; public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; String a = in . next ( ) ; String b = in . next ( ) ; String c = in . next ( ) ; fun ( a , b , c , " F " ) ; fun ( b , a , c , " M " ) ; fun ( c , a , b , " S " ) ; if ( flag == false ) System . out . println ( " ? " ) ; in . close ( ) ; } private static void fun ( String a , String b , String c , String ans ) { if ( a . equals ( " rock " ) && b . equals ( " scissors " ) && c . equals ( " scissors " ) ) { System . out . println ( ans ) ; flag = true ; return ; } if ( a . equals ( " scissors " ) && b . equals ( " paper " ) && c . equals ( " paper " ) ) { System . out . println ( ans ) ; flag = true ; return ; } if ( a . equals ( " paper " ) && b . equals ( " rock " ) && c . equals ( " rock " ) ) { System . out . println ( ans ) ; flag = true ; return ; } } }


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

a = input ( ) b = input ( ) c = input ( ) cntA = 0 cntB = 0 cntC = 0 lst = [ ] lst . append ( a ) lst . append ( b ) lst . append ( c ) for i in lst : if i == ' A > B ' or i == ' A > C ' or i == ' C < A ' or i == ' B < A ' : cntA += 1 elif i == ' B > A ' or i == ' B > C ' or i == ' C < B ' or i == ' A < B ' : cntB += 1 elif i == ' C > A ' or i == ' C > B ' or i == ' B < C ' or i == ' A < C ' : cntC += 1 if cntA > cntB and cntA > cntC : if cntB > cntC : print ( ' CBA ' ) else : print ( ' BCA ' ) elif cntB > cntA and cntB > cntC : if cntA > cntC : print ( ' CAB ' ) else : print ( ' ACB ' ) elif cntC > cntA and cntC > cntB : if cntA > cntB : print ( ' BAC ' ) else : print ( ' ABC ' ) else : print ( ' Impossible ' ) NEW_LINE


s = input ( ) , input ( ) , input ( ) t = 0 , 1 , 2 d = { } r = ' Impossible ' for A in t : for B in t : for C in t : if all ( eval ( x ) for x in s ) : d [ A ] = ' A ' d [ B ] = ' B ' d [ C ] = ' C ' r = d [ 0 ] + d [ 1 ] + d [ 2 ] print ( r )   NEW_LINE


dict = { " A " : 0 , " B " : 0 , " C " : 0 } for i in range ( 3 ) : s = input ( ) if ( s [ 1 ] == " > " ) : dict [ s [ 0 ] ] += 1 else : dict [ s [ 2 ] ] += 1 if dict [ " A " ] == dict [ " B " ] or dict [ " B " ] == dict [ " C " ] or dict [ " C " ] == dict [ " A " ] : print ( ' Impossible ' ) else : if dict [ " A " ] == 0 : print ( " A " , end = " " ) elif dict [ " B " ] == 0 : print ( " B " , end = " " ) elif dict [ " C " ] == 0 : print ( " C " , end = " " ) if dict [ " A " ] == 1 : print ( " A " , end = " " ) elif dict [ " B " ] == 1 : print ( " B " , end = " " ) elif dict [ " C " ] == 1 : print ( " C " , end = " " ) if dict [ " A " ] == 2 : print ( " A " , end = " " ) elif dict [ " B " ] == 2 : print ( " B " , end = " " ) elif dict [ " C " ] == 2 : print ( " C " , end = " ▁ " ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Arrays ; import java . util . Comparator ; import java . util . HashMap ; import java . util . HashSet ; import java . util . Map ; import java . util . Scanner ; import java . util . StringTokenizer ;   public class newprac { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int tt = 1 ;


import java . util . * ; public class CodeForces1487B { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; int t = input . nextInt ( ) ; for ( int i = 0 ; i < t ; i ++ ) { int n = input . nextInt ( ) ; int k = input . nextInt ( ) - 1 ; if ( n % 2 == 0 ) { System . out . println ( ( k % n ) + 1 ) ; } else { int m = k / ( n / 2 ) ; System . out . println ( ( k + m ) % n + 1 ) ; } } } }


for _ in range ( int ( input ( ) ) ) : NEW_LINE INDENT n , k = [ int ( e ) for e in input ( ) . split ( ) ] NEW_LINE k -= 1 NEW_LINE print ( ( k + n % 2 * k // ( n // 2 ) ) % n + 1 ) NEW_LINE DEDENT


for __ in range ( int ( input ( ) ) ) : n , k = [ int ( e ) for e in input ( ) . split ( ) ] ; k -= 1 ; print ( ( k + n % 2 * k // ( n // 2 ) ) % n + 1 ) NEW_LINE


import java . util . * ; import java . lang . * ; import java . io . * ; import java . math . BigInteger ; public class Test { public static void main ( String [ ] args ) { int T ; Scanner in = new Scanner ( System . in ) ; T = in . nextInt ( ) ; while ( T -- > 0 ) { int n = in . nextInt ( ) , k = in . nextInt ( ) ; k -- ; int ans ; if ( n % 2 == 0 ) ans = ( k % n ) + 1 ; else ans = ( k + ( k / ( n / 2 ) ) ) % n + 1 ; System . out . println ( ans ) ; } } }


import java . util . * ; public class A { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; while ( t -- > 0 ) { long n = sc . nextLong ( ) ; long k = sc . nextLong ( ) ; k -- ; if ( n % 2 == 0 ) { long ans = k % n ; System . out . println ( ans + 1 ) ; } else { long mid = n / 2 ; long ans = ( ( k / mid ) + k ) % n ; System . out . println ( ans + 1 ) ; } } } }


import java . util . * ; import java . math . * ; public class CatCycle { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int runs = sc . nextInt ( ) ; while ( runs -- > 0 ) { int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) - 1 ; int f = n / 2 ; int out = ( k + ( n % 2 ) * k / f ) % n + 1 ; System . out . println ( out ) ; } } }


import java . util . * ;   public class CodeForces626A { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; int n = input . nextInt ( ) ; String s = input . next ( ) ; int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = i + 1 ; j < n ; j ++ ) { int v = 0 ; int h = 0 ; for ( int k = i ; k <= j ; k ++ ) { switch ( s . charAt ( k ) ) { case ' U ' : v ++ ; break ; case ' D ' : v -- ; break ; case ' R ' : h ++ ; break ; case ' L ' : h -- ; break ; } } if ( v == 0 && h == 0 ) { ans ++ ; } } }   System . out . println ( ans ) ; } }

n = int ( input ( ) ) s = input ( ) ans = 0 for i in range ( n ) : x = s [ i ] for j in range ( i + 1 , n ) : x += s [ j ] if x . count ( ' D ' ) == x . count ( ' U ' ) and x . count ( ' L ' ) == x . count ( ' R ' ) : ans += 1     print ( ans ) NEW_LINE


n = int ( input ( ) )   moves = list ( input ( ) )   mapping = { ' U ' : 1 , ' D ' : - 1 , ' R ' : 1 , ' L ' : - 1 }   ans = 0   for i in range ( n ) :   hor = 0 vert = 0   for j in range ( i , n ) :                     move = moves [ j ]   if move == ' U ' or move == ' D ' :   vert += mapping [ move ]   else :   hor += mapping [ move ]             if hor == 0 and vert == 0 :   ans += 1   print ( ans ) NEW_LINE


dic = { ' vert ' : 0 , ' horz ' : 0 } copydic = dic . copy ( ) n = int ( input ( ) ) s = input ( ) count = 0 dics = { ' U ' : 1 , ' D ' : - 1 , ' L ' : - 1 , ' R ' : 1 } for i in range ( n ) : for j in range ( i , n ) : if s [ j ] == ' U ' or s [ j ] == ' D ' : dic [ ' vert ' ] += dics [ s [ j ] ] else : dic [ ' horz ' ] += dics [ s [ j ] ] if dic [ ' vert ' ] == dic [ ' horz ' ] == 0 : count += 1 dic = copydic . copy ( ) print ( count ) NEW_LINE


n = int ( input ( ) ) s = input ( ) ans = 0 for i in range ( n ) : k = s [ i : ] d = [ 0 , 0 ] for j in range ( len ( k ) ) : if k [ j ] == " U " : d [ 1 ] += 1 elif k [ j ] == " D " : d [ 1 ] -= 1 elif k [ j ] == " L " : d [ 0 ] -= 1 else : d [ 0 ] += 1 if d == [ 0 , 0 ] : ans += 1 print ( ans ) NEW_LINE


n = int ( input ( ) ) s = str ( input ( ) ) count = 0 for j in range ( n ) : x , y = 0 , 0 for k in range ( j , n ) : if s [ k ] == ' D ' : y -= 1 elif s [ k ] == ' U ' : y += 1 elif s [ k ] == ' R ' : x += 1 else : x -= 1 if x == 0 and y == 0 : count += 1 print ( count ) NEW_LINE


import com . sun . org . apache . bcel . internal . generic . AALOAD ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . * ; import java . util . stream . IntStream ; import javafx . util . Pair ;   public class Main {   static void sort ( int a [ ] ) { Random ran = new Random ( ) ; for ( int i = 0 ; i < a . length ; i ++ ) { int r = ran . nextInt ( a . length ) ; int temp = a [ r ] ; a [ r ] = a [ i ] ; a [ i ] = temp ; }   Arrays . sort ( a ) ; }   public static void main ( String [ ] args ) throws IOException { Scanner input = new Scanner ( System . in ) ; int n = input . nextInt ( ) ; String s = input . next ( ) ; int count = 0 ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j <= i ; j ++ ) { int x = 0 , y = 0 ; for ( int k = j ; k <= i ; k ++ ) {


import java . util . * ; import java . math . * ; import java . io . * ; import java . lang . * ; public class reorder { static class FastReader { BufferedReader br ; StringTokenizer st ; public FastReader ( ) { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; } String next ( ) { while ( st == null || ! st . hasMoreElements ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; } int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; } String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; } int [ ] nextIntArray ( int n ) { int a [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = Integer . parseInt ( next ( ) ) ; } return a ; } } private static long startTime = System . currentTimeMillis ( ) ; public static void main ( String [ ] args ) { FastReader sc = new FastReader ( ) ; long n = sc . nextInt ( ) ; long k = sc . nextInt ( ) ; long temp = Math . max ( n - 2 * k , 0 ) ; System . out . println ( ( n * ( n - 1 ) / 2 ) - ( temp * ( temp - 1 ) / 2 ) ) ;    } }

n , s = map ( int , input ( ) . rstrip ( ) . split ( " ▁ " ) ) if s == 0 or n == 1 : print ( 0 ) elif s >= n // 2 : print ( ( n - 1 ) * ( n ) // 2 ) else : t = 0 for i in range ( s ) : t += ( n - 1 - i ) for i in range ( s , n - s ) : t += s for i in range ( s ) : t += i print ( t ) NEW_LINE


n , k = map ( int , input ( ) . split ( ) ) p = n // 2 p = min ( p , k ) s = 0 for j in range ( p * 2 ) : s = s + n - 1 n = n - 1 print ( s ) NEW_LINE


n , k = map ( int , input ( ) . split ( ) ) if k == 0 or n == 1 : print ( 0 ) elif k >= n // 2 : print ( ( ( n - 1 ) * n ) // 2 ) else : ans = 0 for i in range ( 1 , n + 1 ) : if i <= k : ans += n - i elif i <= n - k : ans += k for j in range ( k - 1 , - 1 , - 1 ) : ans += j print ( ans ) NEW_LINE


import java . io . * ; import java . math . * ; import java . security . * ; import java . text . * ; import java . util . * ;    public class CodeForce { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ;


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . StringTokenizer ;   public class B { public static void main ( String [ ] args ) throws IOException { MyScanner sc = new MyScanner ( ) ; PrintWriter out = new PrintWriter ( System . out ) ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; long ans = 0 , cur = 2 * n - 3 ; for ( int i = 0 ; i < k && cur > 0 ; i ++ ) { ans += cur ; cur -= 4 ; } out . println ( ans ) ; out . flush ( ) ; } static class MyScanner { private BufferedReader br ; private StringTokenizer tokenizer ; public MyScanner ( ) { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; } public String next ( ) { while ( tokenizer == null || ! tokenizer . hasMoreTokens ( ) ) { try { tokenizer = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } } return tokenizer . nextToken ( ) ; } public int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } public long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } } }


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


import com . sun . security . jgss . GSSUtil ;   import javax . swing . table . AbstractTableModel ; import java . io . * ; import java . util . * ; import java . util . concurrent . atomic . AtomicReferenceFieldUpdater ;

for _ in range ( int ( input ( ) ) ) : s = input ( ) if s == s [ : : - 1 ] : if s . count ( s [ 0 ] ) == len ( s ) : print ( - 1 ) else : s = list ( s ) x = s . pop ( ) print ( x + ' ' . join ( s ) ) else : print ( s ) NEW_LINE


r = lambda : list ( map ( int , input ( ) . split ( ) ) ) t = int ( input ( ) ) for _ in range ( t ) : s = list ( input ( ) ) if ( len ( set ( s ) ) == 1 ) : print ( - 1 ) else : print ( ' ' . join ( sorted ( s ) ) ) NEW_LINE


n = int ( input ( ) ) for i in range ( n ) : s = input ( ) if s != s [ : : - 1 ] : print ( s ) else : t = s [ 1 : ] + s [ 0 ] if s == t : print ( " - 1" ) else : print ( t ) NEW_LINE


cases = int ( input ( ) ) while cases : cases -= 1 s = sorted ( input ( ) )   if s == s [ : : - 1 ] : print ( - 1 ) else : print ( " " . join ( s ) )       NEW_LINE


import java . util . Scanner ; import java . util . * ; public class sol { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; while ( t > 0 ) { String s = sc . next ( ) ; int ar [ ] = new int [ 26 ] ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { ar [ s . charAt ( i ) - ' a ' ] ++ ; }


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


import java . util . * ;   public class StackBracket { 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 [ n ] ; for ( int j = 0 ; j < n ; j ++ ) { ar [ j ] = sc . nextInt ( ) ; } int [ ] minar = new int [ n ] ;

from sys import * input = stdin . readlinet = int ( input ( ) ) for _ in range ( t ) : n = int ( input ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) m = [ - 1 ] * n least = l [ - 1 ] for i in range ( n - 2 , - 1 , - 1 ) : if ( least >= l [ i ] ) : least = l [ i ] else : m [ i ] = least bad = n - m . count ( - 1 ) NEW_LINE


t = int ( input ( ) ) for _ in range ( t ) : n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) ans = 0 mm = a [ n - 1 ] for i in range ( n - 1 , - 1 , - 1 ) : if ( a [ i ] < mm ) : mm = a [ i ] if ( a [ i ] > mm ) : ans += 1 print ( ans ) NEW_LINE


for _ in range ( int ( input ( ) ) ) : n = int ( input ( ) ) li = list ( map ( int , input ( ) . split ( ) ) ) if n == 1 : print ( 0 ) else : res = [ li [ 0 ] ] ans = 0 for i in range ( 1 , n ) : if res != [ ] : if li [ i ] >= res [ - 1 ] : res . append ( li [ i ] ) else : while ( 1 ) : if res != [ ] : if res [ - 1 ] > li [ i ] : res . pop ( ) ans += 1 else : res . append ( li [ i ] ) break else : res . append ( li [ i ] ) break else : res . append ( li [ i ] ) print ( ans ) NEW_LINE


t = int ( input ( ) )   for p in range ( t ) : n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) mini = 10000000 c = 0 for i in range ( n - 1 , - 1 , - 1 ) : if a [ i ] <= mini : mini = a [ i ] else : c += 1 print ( c ) NEW_LINE


import sys , math , itertoolsfrom collections import Counter , deque , defaultdictfrom bisect import bisect_left , bisect_right from heapq import heappop , heappush , heapifyfrom 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 list ( tmp [ : x ] ) def err ( x ) : print ( x ) ; exit ( )   for _ in range ( inp ( ) ) : n = inp ( ) a = inpl ( ) res = 0 mi = INF for i in range ( n ) [ : : - 1 ] : mi = min ( mi , a [ i ] ) if i == 0 : break if a [ i - 1 ] > mi : res += 1 print ( res ) NEW_LINE


import java . util . Scanner ; public class Main { public static void main ( String args [ ] ) { Scanner s = new Scanner ( System . in ) ; int t = s . nextInt ( ) ; while ( t -- != 0 ) { int n = s . nextInt ( ) ; long arr [ ] = new long [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = s . nextLong ( ) ; } long suffix [ ] = new long [ n ] ; suffix [ n - 1 ] = arr [ n - 1 ] ; int count = 0 ; for ( int i = n - 2 ; i >= 0 ; i -- ) { suffix [ i ] = Math . min ( suffix [ i + 1 ] , arr [ i ] ) ; if ( arr [ i ] > suffix [ i ] ) { count ++ ; } } System . out . println ( count ) ; } } }


import java . io . * ; import java . util . * ; public class B { static PrintWriter out = new PrintWriter ( System . out ) ; public static void main ( String args [ ] ) throws IOException { Scanner sc = new Scanner ( System . in ) ; int tc = sc . nextInt ( ) ; while ( tc -- > 0 ) { int n = sc . nextInt ( ) ; PriorityQueue < Integer > pq = new PriorityQueue < > ( ) ; int c = 0 ; int arr [ ] = sc . nextIntArr ( n ) ; for ( int i = n - 1 ; i > - 1 ; i -- ) { int a = arr [ i ] ; if ( i < n - 1 ) { if ( pq . peek ( ) < a ) c ++ ; } pq . add ( a ) ; } out . println ( c ) ; } out . close ( ) ; } static class Scanner { StringTokenizer st ; BufferedReader br ; public Scanner ( InputStream s ) { br = new BufferedReader ( new InputStreamReader ( s ) ) ; } public Scanner ( String file ) throws FileNotFoundException { br = new BufferedReader ( new FileReader ( file ) ) ; } public String next ( ) throws IOException { while ( st == null || ! st . hasMoreTokens ( ) ) st = new StringTokenizer ( br . readLine ( ) ) ; return st . nextToken ( ) ; } public int nextInt ( ) throws IOException { return Integer . parseInt ( next ( ) ) ; } public long nextLong ( ) throws IOException { return Long . parseLong ( next ( ) ) ; } public String nextLine ( ) throws IOException { return br . readLine ( ) ; } public double nextDouble ( ) throws IOException { return Double . parseDouble ( next ( ) ) ; } public boolean ready ( ) throws IOException { return br . ready ( ) ; } public int [ ] nextIntArr ( int n ) throws IOException { int arr [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) arr [ i ] = nextInt ( ) ; return arr ; } } }


import java . util . * ; public class MyClass { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; while ( t -- > 0 ) { int n = sc . nextInt ( ) ; int [ ] arr = new int [ n ] ; int c = 0 ; for ( int i = 0 ; i < n ; i ++ ) arr [ i ] = sc . nextInt ( ) ; int min = arr [ n - 1 ] ; for ( int i = n - 1 ; i >= 0 ; i -- ) { if ( arr [ i ] > min ) { c ++ ; } min = Math . min ( arr [ i ] , min ) ; } System . out . println ( c ) ; } } }


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

q , w = map ( int , input ( ) . split ( ) ) e = [ 0 ] * qr = [ 0 ] * qans = [ ] for i in range ( q ) : e [ i ] = list ( map ( int , input ( ) . split ( ) ) ) r [ i ] = [ 0 ] * wfor i in range ( q - 1 ) : for j in range ( w - 1 ) : if e [ i ] [ j ] and e [ i + 1 ] [ j ] and e [ i ] [ j + 1 ] and e [ i + 1 ] [ j + 1 ] : ans . append ( ( i + 1 , j + 1 ) ) r [ i ] [ j ] = 1 r [ i + 1 ] [ j ] = 1 r [ i ] [ j + 1 ] = 1 r [ i + 1 ] [ j + 1 ] = 1 if e == r : print ( len ( ans ) ) for i in ans : print ( * i ) else : print ( - 1 ) NEW_LINE


def fill_square ( r , c , l ) : m = [ [ 0 ] * c for _ in range ( r ) ] k = [ ] for i in range ( r - 1 ) : for j in range ( c - 1 ) : if l [ i ] [ j ] and l [ i + 1 ] [ j ] and l [ i ] [ j + 1 ] and l [ i + 1 ] [ j + 1 ] : m [ i ] [ j ] = m [ i + 1 ] [ j ] = m [ i ] [ j + 1 ] = m [ i + 1 ] [ j + 1 ] = 1 k . append ( [ i + 1 , j + 1 ] ) if l == m : print ( len ( k ) ) for i in k : print ( * i ) else : print ( - 1 )       r , c = map ( int , input ( ) . split ( ) ) l = [ list ( map ( int , input ( ) . split ( ) ) ) for _ in range ( r ) ] fill_square ( r , c , l ) NEW_LINE


n , m = map ( int , input ( ) . split ( ) ) lst , ans , f = [ ] , [ ] , 0 for i in range ( n ) : lst . append ( list ( map ( int , input ( ) . split ( ) ) ) ) for i in range ( n ) : for j in range ( m ) : if lst [ i ] [ j ] == 1 : if not ( ( i - 1 >= 0 and j - 1 >= 0 and lst [ i - 1 ] [ j - 1 ] == lst [ i - 1 ] [ j ] == lst [ i ] [ j - 1 ] == 1 ) or ( i + 1 <= n - 1 and j + 1 <= m - 1 and lst [ i + 1 ] [ j + 1 ] == lst [ i + 1 ] [ j ] == lst [ i ] [ j + 1 ] == 1 ) or ( i + 1 <= n - 1 and j - 1 >= 0 and lst [ i ] [ j - 1 ] == lst [ i + 1 ] [ j - 1 ] == lst [ i + 1 ] [ j ] == 1 ) or ( i - 1 >= 0 and j + 1 <= m - 1 and lst [ i - 1 ] [ j + 1 ] == lst [ i ] [ j + 1 ] == lst [ i - 1 ] [ j ] == 1 ) ) : f = 1 ; break if i + 1 <= n - 1 and j + 1 <= m - 1 and lst [ i + 1 ] [ j + 1 ] == lst [ i + 1 ] [ j ] == lst [ i ] [ j + 1 ] == 1 : ans . append ( [ i + 1 , j + 1 ] ) if f == 1 : breakif f == 1 : print ( - 1 ) else : print ( len ( ans ) ) for i in ans : print ( * i ) NEW_LINE


n , m = map ( int , input ( ) . split ( ) ) A = [ ] B = [ ] x = 0 y = 0 ans = [ ] for i in range ( n ) : A . append ( input ( ) . split ( ) ) B . append ( [ '0' ] * len ( A [ i ] ) ) while x < n - 1 : y = 0 while y < m - 1 : if y + 1 <= m - 1 and x + 1 <= n - 1 : if A [ x ] [ y ] == '1' and A [ x + 1 ] [ y ] == '1' and A [ x ] [ y + 1 ] == '1' and A [ x + 1 ] [ y + 1 ] == '1' : ans . append ( [ x + 1 , y + 1 ] ) B [ x ] [ y ] = '1' B [ x + 1 ] [ y ] = '1' B [ x ] [ y + 1 ] = '1' B [ x + 1 ] [ y + 1 ] = '1' y += 1 x += 1 error = 0 for i in range ( n ) : A [ i ] = ' ' . join ( A [ i ] ) B [ i ] = ' ' . join ( B [ i ] ) if A [ i ] . count ( '1' ) != B [ i ] . count ( '1' ) : error = 1 breakif error == 0 : print ( len ( ans ) ) for i in range ( len ( ans ) ) : print ( * ans [ i ] ) else : print ( - 1 ) NEW_LINE


import java . util . * ; import java . util . Arrays ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long n = sc . nextLong ( ) ; long a = sc . nextLong ( ) ; long b = sc . nextLong ( ) ; if ( a + b <= n + 1 ) { System . out . println ( " White " ) ; } else { System . out . println ( " Black " ) ; } } }

def pasos ( w , m ) : w = [ abs ( m [ 0 ] - w [ 0 ] ) , abs ( m [ 1 ] - w [ 1 ] ) ] minimo = min ( w ) w [ 0 ] -= minimo w [ 1 ] -= minimo return sum ( w ) + minimo def chess ( n , x , y ) : m = [ x , y ] wk = [ 1 , 1 ] bk = [ n , n ] if ( x + y == 2 ) : print ( " White " ) elif ( x == n and y == n ) : print ( " Black " ) else : pasosW = pasos ( wk , m ) pasosB = pasos ( bk , m ) if pasosB < pasosW : print ( " Black " ) else : print ( " White " ) def prueba ( ) : n = int ( input ( ) ) x , y = [ int ( i ) for i in input ( ) . split ( " ▁ " ) ] chess ( n , x , y ) prueba ( ) NEW_LINE


n = int ( input ( ) ) x , y = list ( map ( int , input ( ) . split ( ) ) ) wm = max ( x - 1 , y - 1 ) bm = max ( n - x , n - y ) print ( " Black " if bm < wm else " White " ) NEW_LINE


n = int ( input ( ) ) x , y = map ( int , input ( ) . split ( ) )     distance_w = min ( abs ( x - 1 ) , abs ( y - 1 ) ) distance_b = min ( abs ( n - x ) , abs ( n - y ) )     cur_w_x = cur_w_y = 1 + distance_w cur_b_y = cur_b_x = n - distance_b     if ( cur_w_x == x ) : distance_w = distance_w + abs ( cur_w_y - y ) else : distance_w = distance_w + abs ( cur_w_x - x ) if ( cur_b_x == x ) : distance_b = distance_b + abs ( cur_b_y - y ) else : distance_b = distance_b + abs ( cur_b_x - x ) if ( distance_w <= distance_b ) : print ( " white " ) else : print ( " black " ) NEW_LINE


n = int ( input ( ) ) x , y = map ( int , input ( ) . split ( ) ) min = x if x < y else ymax = x if x > y else yif min - 1 <= n - max : print ( " White " ) else : print ( " Black " ) NEW_LINE


n = int ( input ( ) ) x , y = map ( int , input ( ) . split ( " ▁ " ) ) if x + y > n + 1 : print ( " Black " ) else : print ( " White " ) NEW_LINE


import java . io . * ; import java . util . * ; import javax . print . attribute . standard . Finishings ;   import java . math . * ;   public class Exam { static final Random random = new Random ( ) ; static PrintWriter out = new PrintWriter ( ( System . out ) ) ; static Reader sc = new Reader ( ) ;   public static void main ( String args [ ] ) throws IOException {


import java . util . * ; import java . io . * ; import java . lang . * ; public class MainClass { private static BufferedReader br = null ; private static StringTokenizer st = null ; static { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; } private static String str ( ) throws IOException { return br . readLine ( ) ; } private static int ints ( ) throws IOException { return Integer . parseInt ( br . readLine ( ) ) ; } private static int [ ] ints ( int N ) throws IOException { st = new StringTokenizer ( br . readLine ( ) ) ; int [ ] nums = new int [ N ] ; for ( int i = 0 ; i < N ; i += 1 ) { nums [ i ] = Integer . parseInt ( st . nextToken ( ) ) ; } return nums ; } public static void main ( String [ ] args ) throws IOException { long N = Long . parseLong ( br . readLine ( ) ) ; String [ ] arr = br . readLine ( ) . split ( " ▁ " ) ; long x = Long . parseLong ( arr [ 0 ] ) , y = Long . parseLong ( arr [ 1 ] ) ; Solution obj = new Solution ( ) ; System . out . println ( obj . whoIsWinner ( x , y , N ) ) ; br . close ( ) ; } } class Solution { public String whoIsWinner ( long x , long y , long N ) { if ( x == 1 && y == 1 ) return " White " ; if ( x == N && y == N ) return " Black " ; return Math . max ( N - x , N - y ) < Math . max ( x - 1 , y - 1 ) ? " Black " : " White " ; } }


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


import java . util . * ; public class P2 {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long n = sc . nextLong ( ) ; long x = sc . nextLong ( ) ; long y = sc . nextLong ( ) ; long wm = 0 ; long bm = 0 ; long min = Math . min ( x , y ) ; long max = Math . max ( x , y ) ; wm = min - 1 ; wm += ( max - min ) ; bm = n - max ; bm += ( max - min ) ; if ( wm == bm ) { System . out . println ( " White " ) ; } else if ( wm > bm ) { System . out . println ( " Black " ) ; } else { System . out . println ( " White " ) ; } } }


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ;   public class CF411B { public static int [ ] processor ( int [ ] [ ] instructions , int n , int m , int k ) { int [ ] lockedCycle = new int [ n ] ; int [ ] cells = new int [ k ] ; reset ( cells ) ;   for ( int i = 0 ; i < m ; i ++ ) { for ( int j = 0 ; j < n ; j ++ ) { int cell = instructions [ j ] [ i ] - 1 ; if ( cell == - 1 )

from collections import defaultdictn , m , k = [ int ( i ) for i in input ( ) . split ( ) ] cell = [ 0 for i in range ( k + 1 ) ] core = [ 0 for i in range ( n + 1 ) ]   NEW_LINE


from collections import Countern , m , k = map ( int , input ( ) . split ( ) ) a = [ list ( map ( int , input ( ) . split ( ) ) ) for i in range ( n ) ] v , l = [ 0 ] * n , [ False ] * kfor j in range ( m ) : c = Counter ( a [ i ] [ j ] for i in range ( n ) ) for i in range ( n ) : if not v [ i ] and a [ i ] [ j ] and ( l [ a [ i ] [ j ] - 1 ] or c [ a [ i ] [ j ] ] > 1 ) : v [ i ] = j + 1 l [ a [ i ] [ j ] - 1 ] = True a [ i ] = [ 0 ] * mprint ( * v , sep = ' \n ' ) NEW_LINE


def adds ( memtoproc , mem , proc ) : if mem in memtoproc : memtoproc [ mem ] . append ( proc ) else : memtoproc [ mem ] = [ proc ]   def corr ( arr , n , m ) : brokemems = set ( ) stopprocs = [ 0 ] * n for c in range ( m ) : memtoproc = dict ( ) usemems = set ( ) locmems = set ( ) for d in range ( n ) : if not arr [ d ] [ c ] or stopprocs [ d ] : continue adds ( memtoproc , arr [ d ] [ c ] , d ) if arr [ d ] [ c ] in usemems : locmems . add ( arr [ d ] [ c ] ) usemems . add ( arr [ d ] [ c ] ) if arr [ d ] [ c ] in brokemems : if not stopprocs [ d ] : stopprocs [ d ] = c + 1 for d in locmems : brokemems . add ( d ) procs = memtoproc [ d ] for x in procs : if not stopprocs [ x ] : stopprocs [ x ] = c + 1 return stopprocs                           n , m , k = map ( int , input ( ) . split ( ' ▁ ' ) ) arr = [ ] for c in range ( n ) : arr . append ( tuple ( map ( int , input ( ) . split ( ' ▁ ' ) ) ) ) procs = corr ( arr , n , m ) for c in procs : print ( c )   NEW_LINE


from collections import Counter   n , m , k = map ( int , input ( ) . split ( ) )   a = [ list ( map ( int , input ( ) . split ( ) ) ) for i in range ( n ) ]   v , l = [ 0 ] * n , [ False ] * k   for j in range ( m ) :   c = Counter ( a [ i ] [ j ] for i in range ( n ) )   for i in range ( n ) :   if not v [ i ] and a [ i ] [ j ] and ( l [ a [ i ] [ j ] - 1 ] or c [ a [ i ] [ j ] ] > 1 ) :   v [ i ] = j + 1   l [ a [ i ] [ j ] - 1 ] = True   a [ i ] = [ 0 ] * m   print ( * v , sep = ' \n ' )           NEW_LINE


import java . util . * ; public class Watermelon { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; int mem [ ] = new int [ k + 1 ] ; int memf [ ] = new int [ k + 1 ] ; int p [ ] [ ] = new int [ n ] [ m ] ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < m ; j ++ ) { p [ i ] [ j ] = sc . nextInt ( ) ; } } HashMap < Integer , Integer > hm = new HashMap < > ( ) ; int cnt = 1 ; for ( int i = 0 ; i < m ; i ++ ) { for ( int j = 0 ; j < n ; j ++ ) { if ( hm . get ( j + 1 ) == null ) { if ( p [ j ] [ i ] == 0 ) {   } else if ( mem [ p [ j ] [ i ] ] == - 1 ) { hm . put ( j + 1 , i ) ; } else if ( mem [ p [ j ] [ i ] ] == cnt ) { hm . put ( j + 1 , i ) ; hm . put ( memf [ p [ j ] [ i ] ] , i ) ; mem [ p [ j ] [ i ] ] = - 1 ; } else { mem [ p [ j ] [ i ] ] = cnt ; memf [ p [ j ] [ i ] ] = j + 1 ; } } } cnt ++ ; } for ( int i = 1 ; i <= n ; i ++ ) { if ( hm . get ( i ) == null ) { System . out . println ( 0 ) ; } else { System . out . println ( hm . get ( i ) + 1 ) ; } } }   }


import java . util . * ; import java . lang . * ; import java . io . * ;   public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; int [ ] [ ] memoryAccess = new int [ n ] [ m ] ;   for ( int i = 0 ; i < n ; ++ i ) { for ( int j = 0 ; j < m ; ++ j ) { memoryAccess [ i ] [ j ] = sc . nextInt ( ) ; } } int [ ] deadlock = new int [ n ] ; int [ ] blockedCores = new int [ n ] ; for ( int i = 0 ; i < m ; ++ i ) { int [ ] counter = new int [ k + 1 ] ;   for ( int j = 0 ; j < n ; ++ j ) { if ( deadlock [ j ] > 0 ) { memoryAccess [ j ] [ i ] = deadlock [ j ] ; } ++ counter [ memoryAccess [ j ] [ i ] ] ; } for ( int j = 0 ; j < n ; ++ j ) { if ( memoryAccess [ j ] [ i ] > 0 && counter [ memoryAccess [ j ] [ i ] ] > 1 && deadlock [ j ] < 1 ) { blockedCores [ j ] = i + 1 ; deadlock [ j ] = memoryAccess [ j ] [ i ] ; } } } for ( int i = 0 ; i < n ; ++ i ) { System . out . println ( blockedCores [ i ] ) ; } } }


import javax . swing . * ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . * ;   import static java . lang . Integer . * ;   public class Example {   public static void main ( String [ ] args ) {    Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int sum = 0 ; Map < Integer , Integer > map = new HashMap < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { int a = sc . nextInt ( ) ; if ( a == i ) sum ++ ; else map . put ( i , a ) ;   } List < Integer > list = new ArrayList < > ( map . keySet ( ) ) ; boolean tt = false ; for ( Integer integer : list ) {    int v1 = map . get ( integer ) ; int v2 = map . get ( v1 ) ; if ( v2 == integer ) { tt = true ; break ; }   }

n = int ( input ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) c = 0 i = 0 while i < n : if arr [ i ] == i : c += 1 i += 1j = 0 flag = Falsewhile j < n : temp = arr [ j ] if arr [ temp ] == j and temp != j : flag = True break j += 1   if flag == False : if c + 1 > n : print ( n ) else : print ( c + 1 )   elif flag == True : if c + 2 > n : print ( n ) else : print ( c + 2 ) NEW_LINE


n = int ( input ( ) ) li = list ( map ( int , input ( ) . split ( " ▁ " ) ) )   indexes = [ 0 ] * n   i = 0 while i < len ( li ) : indexes [ li [ i ] ] = i i += 1   swapped = Falseallequal = Truei = 0 count = 0 while i < len ( li ) : if li [ i ] == i : count += 1 else : allequal = False if swapped == False : if indexes [ i ] == li [ i ] : count += 2 swapped = True i += 1 if swapped == False and allequal == False : count += 1 print ( count ) NEW_LINE


n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ' ▁ ' ) ) ) c = 0 for i in range ( n ) : if i == a [ i ] : c += 1 if c == n : print ( n ) else : for i in range ( n ) : if i != a [ i ] and a [ a [ i ] ] == i : print ( c + 2 ) break else : print ( c + 1 ) NEW_LINE


n = int ( input ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) d = { } ans = 0 flag = Falsefor i , x in enumerate ( arr ) : d [ i ] = x if i == x : ans += 1 for i in d : if i != d [ i ] and d [ d [ i ] ] == i : ans += 2 flag = True breakif flag : print ( ans ) else : if ans == len ( arr ) : print ( ans ) else : print ( ans + 1 ) NEW_LINE


n = int ( input ( ) ) c = 0 cc = 0 l = list ( map ( int , input ( ) . split ( ) ) ) for i in range ( n ) : if l [ i ] == i : c += 1 elif i == l [ l [ i ] ] : cc = 1 print ( c + cc + int ( c != n ) ) NEW_LINE


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


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

from sys import stdindef g ( t ) : t = str ( t ) s = 1 for i in range ( len ( t ) ) : if t [ i ] != "0" : s *= int ( t [ i ] ) return sdef main ( ) : memo = [ - 1 ] * ( 10 ** 6 + 1 ) for i in range ( 10 ) : memo [ i ] = i for i in range ( 10 , 10 ** 6 + 1 ) : x = i while x > 9 : if memo [ x ] > 0 : x = memo [ x ] x = g ( x ) memo [ i ] = x cnt = [ [ 0 ] * 10 for i in range ( 10 ** 6 + 1 ) ] for i in range ( 1 , 10 ** 6 + 1 ) : cnt [ i ] [ memo [ i ] ] += 1 for j in range ( 10 ) : cnt [ i ] [ j ] += cnt [ i - 1 ] [ j ] Q = int ( input ( ) ) for _ in range ( Q ) : l , r , k = map ( int , stdin . readline ( ) . split ( ) ) print ( cnt [ r ] [ k ] - cnt [ l - 1 ] [ k ] ) main ( ) NEW_LINE


z , zz = input , lambda : list ( map ( int , z ( ) . split ( ) ) ) fast = lambda : stdin . readline ( ) . strip ( ) zzz = lambda : [ int ( i ) for i in fast ( ) . split ( ) ] szz , graph , mod , szzz = lambda : sorted ( zz ( ) ) , { } , 10 ** 9 + 7 , lambda : sorted ( zzz ( ) ) from string import * from re import * from collections import * from queue import * from sys import * from collections import * from math import * from heapq import * from itertools import * from bisect import * from collections import Counter as ccfrom math import factorial as ffrom bisect import bisect as bsfrom bisect import bisect_left as bslfrom itertools import accumulate as acdef lcd ( xnum1 , xnum2 ) : return ( xnum1 * xnum2 // gcd ( xnum1 , xnum2 ) ) def prime ( x ) : p = ceil ( x ** .5 ) + 1 for i in range ( 2 , p ) : if ( x % i == 0 and x != 2 ) or x == 0 : return 0 return 1 def dfs ( u , visit , graph ) : visit [ u ] = 1 for i in graph [ u ] : if not visit [ i ] : dfs ( i , visit , graph )   NEW_LINE


fast = lambda : stdin . readline ( ) . strip ( ) zzz = lambda : [ int ( i ) for i in fast ( ) . split ( ) ] z , zz = input , lambda : list ( map ( int , z ( ) . split ( ) ) ) szz , graph , mod , szzz = lambda : sorted ( zz ( ) ) , { } , 10 ** 9 + 7 , lambda : sorted ( zzz ( ) ) from re import * from sys import * from math import * from heapq import * from queue import * from bisect import * from string import * from itertools import * from collections import * from math import factorial as ffrom bisect import bisect as bsfrom bisect import bisect_left as bslfrom collections import Counter as ccfrom itertools import accumulate as acdef lcd ( xnum1 , xnum2 ) : return ( xnum1 * xnum2 // gcd ( xnum1 , xnum2 ) ) def prime ( x ) : p = ceil ( x ** .5 ) + 1 for i in range ( 2 , p ) : if ( x % i == 0 and x != 2 ) or x == 0 : return 0 return 1 def dfs ( u , visit , graph ) : visit [ u ] = 1 for i in graph [ u ] : if not visit [ i ] : dfs ( i , visit , graph ) def output ( answer ) : stdout . write ( str ( answer ) ) NEW_LINE


from sys import stdin , stdoutans = ' ' ; z1 = [ [ ] ] def gh ( x ) : if x < 10 : return x p = 1 while x : if x % 10 : p *= ( x % 10 ) x //= 10 return gh ( p ) for i in range ( 9 ) : z1 += [ [ 0 ] * ( 1000001 ) ] for i in range ( 1 , 1000001 ) : z1 [ gh ( i ) ] [ i ] += 1 for i in range ( 1 , 10 ) : for j in range ( 1 , 1000001 ) : z1 [ i ] [ j ] += z1 [ i ] [ j - 1 ] for _ in " ▁ " * int ( stdin . readline ( ) ) : a , b , c = map ( int , stdin . readline ( ) . split ( ) ) ; print ( z1 [ c ] [ b ] - z1 [ c ] [ a - 1 ] ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Scanner ; import java . util . StringTokenizer ; import java . util . * ; public class c701b {


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . StringTokenizer ;    public class Main { public static int [ ] [ ] ans = new int [ 10 ] [ 1000005 ] ; public static int check ( int x , int y ) { while ( true ) { if ( y < 10 ) { if ( y == x ) return 1 ; else return 0 ; } else { int temp = 1 ; while ( y > 0 ) { int rem = y % 10 ; y /= 10 ; if ( rem > 0 ) temp *= rem ; } y = temp ; } } }   public static void init ( ) { for ( int i = 1 ; i < 10 ; i ++ ) for ( int j = 1 ; j < 1000002 ; j ++ ) ans [ i ] [ j ] = ans [ i ] [ j - 1 ] + check ( i , j ) ; }   public static void main ( String args [ ] ) throws IOException { init ( ) ; BufferedReader BR = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer ST ; PrintWriter out = new PrintWriter ( System . out ) ; int q , l , r , k ; q = Integer . parseInt ( BR . readLine ( ) ) ; while ( q -- > 0 ) { ST = new StringTokenizer ( BR . readLine ( ) ) ; l = Integer . parseInt ( ST . nextToken ( ) ) ; r = Integer . parseInt ( ST . nextToken ( ) ) ; k = Integer . parseInt ( ST . nextToken ( ) ) ; out . println ( ans [ k ] [ r ] - ans [ k ] [ l - 1 ] ) ; } out . close ( ) ; } }


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


import java . util . * ; import java . io . * ; import java . math . * ; public class A { static FastReader sc = new FastReader ( ) ; public static void main ( String [ ] args ) {


import java . util . Arrays ; import java . util . Comparator ; import java . util . Scanner ;   public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n , m ; n = sc . nextInt ( ) ; Integer [ ] a = new Integer [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = sc . nextInt ( ) ; } Arrays . sort ( a , new Comparator < Integer > ( ) { @ Override public int compare ( Integer o1 , Integer o2 ) { return o1 - o2 ; } } ) ; int cnt = 0 ; for ( int i = 1 ; i < n ; i ++ ) {

n = int ( input ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) print ( ( max ( l ) - min ( l ) ) - n + 1 ) NEW_LINE


n = int ( input ( ) ) x = list ( map ( int , input ( ) . split ( ) ) ) a = min ( x ) b = max ( x )   print ( b - a + 1 - n ) NEW_LINE


a = int ( input ( ) ) b = list ( map ( int , input ( ) . split ( ) ) ) print ( max ( b ) - min ( b ) + 1 - a ) NEW_LINE


n = int ( input ( ) ) arr = [ int ( num ) for num in input ( ) . split ( ) ]   arr = sorted ( arr )   x = arr [ 0 ]   ans = 0   for num in arr : ans += num - x x = num + 1 print ( ans ) NEW_LINE


import java . util . * ;   public class questionCF {   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 ( ) ;   Arrays . sort ( a ) ; int sum = 0 ; for ( int i = 0 ; i < n - 1 ; i ++ ) sum += a [ i + 1 ] - a [ i ] - 1 ; System . out . println ( sum ) ; } }


import java . util . Arrays ; import java . util . Scanner ;   public class Heist { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] arr = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = sc . nextInt ( ) ; } Arrays . sort ( arr ) ; int count = 0 ; for ( int i = 0 ; i < n - 1 ; i ++ ) { for ( int j = arr [ i ] + 1 ; j < arr [ i + 1 ] ; j ++ ) { count ++ ; } } System . out . println ( count ) ; } }


import java . io . BufferedReader ; import java . io . BufferedWriter ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . OutputStreamWriter ; import java . io . PrintWriter ; import java . util . Arrays ; import java . util . StringTokenizer ;   public class temp4 { static class FastReader { BufferedReader br ; StringTokenizer st ; public FastReader ( ) { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; } String next ( ) { while ( st == null || ! st . hasMoreElements ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; } int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; } String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; } } static class Print { private final BufferedWriter bw ; public Print ( ) { bw = new BufferedWriter ( new OutputStreamWriter ( System . out ) ) ; } public void print ( String str ) throws IOException { bw . append ( str ) ; } public void println ( String str ) throws IOException { print ( str ) ; bw . append ( " \n " ) ; } public void close ( ) throws IOException { bw . close ( ) ; } } public static void main ( String [ ] args ) throws IOException { FastReader scn = new FastReader ( ) ;


import java . util . * ; import java . lang . * ; import java . io . * ; public class Main { PrintWriter out ; FastReader sc ; long mod = ( long ) ( 1e9 + 7 ) ; int maxint = Integer . MAX_VALUE ; int minint = Integer . MIN_VALUE ; long maxlong = Long . MAX_VALUE ; long minlong = Long . MIN_VALUE ; public void sol ( ) { int n = ni ( ) , m = ni ( ) ; int [ ] a = new int [ n ] , b = new int [ n ] ; HashMap < Integer , Integer > map = new HashMap < Integer , Integer > ( ) ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = ni ( ) ; for ( int i = 0 ; i < n ; i ++ ) { b [ i ] = ni ( ) ; map . put ( b [ i ] , map . getOrDefault ( b [ i ] , 0 ) + 1 ) ; } sort ( a ) ; sort ( b ) ; int ans = maxint ; for ( int i = 0 ; i < n ; i ++ ) { int x = ( ( b [ i ] - a [ 0 ] ) % m + m ) % m ; HashMap < Integer , Integer > has = new HashMap < > ( ) ; for ( int j = 0 ; j < n ; j ++ ) { int q = ( a [ j ] + x ) % m ; has . put ( q , has . getOrDefault ( q , 0 ) + 1 ) ; } boolean f = true ; for ( Map . Entry < Integer , Integer > m1 : map . entrySet ( ) ) { int k = m1 . getKey ( ) , v = m1 . getValue ( ) ; if ( has . get ( k ) == null || has . get ( k ) != v ) { f = ! f ; break ; } } if ( f ) { ans = min ( ans , x ) ; } } pl ( ans ) ; } public static void main ( String [ ] args ) { Main g = new Main ( ) ; g . out = new PrintWriter ( System . out ) ; g . sc = new FastReader ( ) ; int t = 1 ;

def solve ( a , b , m ) : n = len ( a ) a . sort ( ) b . sort ( ) best = None for d in range ( n ) : x = ( b [ 0 ] - a [ d ] ) % m if ( best is None or best > x ) and all ( ( a [ ( d + i ) % n ] + x ) % m == b [ i ] for i in range ( n ) ) : best = x return best     n , m = map ( int , input ( ) . split ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) b = list ( map ( int , input ( ) . split ( ) ) ) print ( solve ( a , b , m ) ) NEW_LINE


n , m = map ( int , input ( ) . split ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) b = list ( map ( int , input ( ) . split ( ) ) ) b . sort ( ) a . sort ( ) ans = 100000000000000 for i in range ( n ) : if a [ i ] <= b [ 0 ] : x = b [ 0 ] - a [ i ] else : x = ( m - a [ i ] + b [ 0 ] ) if x < ans : f = True for j in range ( n ) : if ( a [ ( i + j + 1 ) % n ] + x ) % m != b [ ( j + 1 ) % n ] : f = False break if f == True : ans = xprint ( ans ) NEW_LINE


import itertoolsimport bisectimport mathfrom collections import * import osimport sysfrom io import BytesIO , IOBase   ii = lambda : int ( input ( ) ) lmii = lambda : list ( map ( int , input ( ) . split ( ) ) ) li = lambda : list ( input ( ) ) mii = lambda : map ( int , input ( ) . split ( ) ) msi = lambda : map ( str , input ( ) . split ( ) )     def main ( ) : NEW_LINE


import java . io . * ; import java . util . * ; import java . math . * ;     public class Main { public static final Long mod = Long . valueOf ( 998244353 ) ; public static final int N = 200020 ; public static Long [ ] ch = new Long [ N ] ; public static int [ ] deg = new int [ N ] ; public static void main ( String args [ ] ) { Scanner in ; PrintStream out ;

g = [ 0 ] * 200005 r = int ( input ( ) ) n = r for i in range ( 1 , n ) : u , v = map ( int , input ( ) . split ( ) ) g [ u ] += 1 g [ v ] += 1 r *= g [ u ] * g [ v ] r %= 998244353     print ( r ) NEW_LINE


n = int ( input ( ) ) r = n ; MAX = 998244353 arr = [ 0 ] * ( n + 1 ) for i in range ( n - 1 ) : a , b = map ( int , input ( ) . split ( ) ) arr [ a ] += 1 ; arr [ b ] += 1 r *= arr [ a ] * arr [ b ] r %= MAXprint ( r ) NEW_LINE


import java . io . * ; import java . util . * ; import java . math . * ;     public class Main { public static final Long mod = Long . valueOf ( 998244353 ) ; public static final int N = 200020 ; public static Long [ ] ch = new Long [ N ] ; public static int [ ] deg = new int [ N ] ; public static void main ( String args [ ] ) { Scanner in ; PrintStream out ; try { in = new Scanner ( new FileInputStream ( " java . in " ) ) ; out = new PrintStream ( " java . out " ) ; } catch ( FileNotFoundException e ) { in = new Scanner ( new BufferedInputStream ( System . in ) ) ; out = System . out ; } ch [ 0 ] = Long . valueOf ( 1 ) ; for ( int i = 1 ; i < N ; i ++ ) { ch [ i ] = ( ch [ i - 1 ] * i ) % mod ; } int n = in . nextInt ( ) ; Long ans = Long . valueOf ( n ) ; for ( int i = 1 , u , v ; i < n ; i ++ ) { u = in . nextInt ( ) ; v = in . nextInt ( ) ; deg [ u ] ++ ; deg [ v ] ++ ; } for ( int i = 1 ; i <= n ; i ++ ) { ans = ans * ch [ deg [ i ] ] % mod ; } out . println ( ans ) ; } }


import java . util . Scanner ;    public class Dasha_Stairs_761A { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ;   int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ;   if ( a == 0 && b == 0 ) { System . out . println ( " NO " ) ; } else { int diff = Math . abs ( a - b ) ; if ( diff == 1 || a == b ) { System . out . println ( " YES " ) ; } else System . out . println ( " NO " ) ;   } } }

from __future__ import division , print_functionfrom collections import * from math import * from itertools import * import osimport sysfrom io import BytesIO , IOBaseimport math   if sys . version_info [ 0 ] < 3 : from __builtin__ import xrange as range from future_builtins import ascii , filter , hex , map , oct , zip       def main ( ) : a , b = map ( int , input ( ) . split ( ) ) if a == 0 and b == 0 : print ( " NO " ) else : if abs ( a - b ) > 1 : print ( " NO " ) else : print ( " YES " )         NEW_LINE


a , b = [ int ( i ) for i in input ( ) . split ( ) ] if ( abs ( a - b ) > 1 or ( a == 0 and b == 0 ) ) : print ( " NO " ) else : print ( " YES " ) NEW_LINE


import mathdef solve ( a , b ) : if a == 0 and b == 0 : return ' NO ' if abs ( a - b ) <= 1 : return ' YES ' return ' NO '   def main ( ) : arr = list ( map ( int , input ( ) . split ( ' ▁ ' ) ) ) NEW_LINE


a , b = map ( int , input ( ) . split ( ) ) if abs ( a - b ) > 1 or ( a == b == 0 ) : print ( " NO " ) else : print ( " YES " ) NEW_LINE


from __future__ import division , print_functionfrom collections import * from math import * from itertools import * from time import timeimport osimport stringimport sysfrom io import BytesIO , IOBase   if sys . version_info [ 0 ] < 3 : from __builtin__ import xrange as range from future_builtins import ascii , filter , hex , map , oct , zip     def main ( ) : a , b = map ( int , input ( ) . split ( ) ) if b == a and b == 0 : print ( ' NO ' ) return if b - 1 == a or b + 1 == a or b == a : print ( ' YES ' ) else : print ( ' NO ' )             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 . * ; public class MyClass { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; if ( a == 0 & b == 0 || Math . abs ( a - b ) > 1 ) System . out . println ( " NO " ) ; else System . out . println ( " YES " ) ; } }


import java . util . Scanner ;   public class Main { static int n , m ; public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; n = scanner . nextInt ( ) ; m = scanner . nextInt ( ) ; String s1 = scanner . next ( ) ; String s2 = scanner . next ( ) ; if ( ! s1 . contains ( " * " ) ) { if ( ! s1 . equals ( s2 ) ) System . out . println ( " NO " ) ; else System . out . println ( " YES " ) ; } else {

n , m = map ( int , input ( ) . split ( ) ) s = str ( input ( ) ) t = str ( input ( ) ) if ' * ' in s : a , b = s . split ( ' * ' ) s1 = t . startswith ( a ) s2 = t [ len ( a ) : ] . endswith ( b ) if s1 and s2 : print ( " YES " ) else : print ( " NO " ) else : if s == t : print ( " YES " ) else : print ( " NO " ) NEW_LINE


n , m = map ( int , input ( ) . split ( ) ) s = input ( ) t = input ( ) if n == 1 : if s == t or s == ' * ' : print ( ' YES ' ) else : print ( ' NO ' ) elif s . count ( ' * ' ) == 0 : if s == t : print ( ' YES ' ) else : print ( ' NO ' ) elif n > m + 1 : print ( ' NO ' ) else : l = s . split ( ' * ' ) x = t [ : len ( l [ 0 ] ) ] y = t [ - len ( l [ 1 ] ) : ] if ( l [ 0 ] == x and l [ 1 ] == y ) or ( s [ : 1 ] == ' * ' and l [ 1 ] == y ) or ( l [ 0 ] == x and s [ - 1 : ] == ' * ' ) : print ( ' YES ' ) else : print ( ' NO ' ) NEW_LINE


a , b = [ * open ( 0 ) ] [ 1 : ] if ' * ' in a : x , y = a . split ( ' * ' ) r = b . startswith ( x ) and b [ len ( x ) : ] . endswith ( y ) else : r = a == bprint ( ' NYOE ▁ S ' [ r : : 2 ] ) NEW_LINE


n , m = map ( int , input ( ) . split ( ) ) s = input ( ) t = input ( ) if m >= n - 1 and s [ : s . find ( ' * ' ) ] == t [ : s . find ( ' * ' ) ] and s [ s . find ( ' * ' ) + 1 : ] == t [ len ( t ) - len ( s ) + s . find ( ' * ' ) + 1 : ] : print ( ' YES ' ) else : print ( ' NO ' ) NEW_LINE


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


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


import java . util . Scanner ; import java . io . BufferedInputStream ; public class Solution { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( new BufferedInputStream ( System . in ) ) ; int lengthOfN = scanner . nextInt ( ) ; int lengthOfM = scanner . nextInt ( ) ; String n = scanner . next ( ) ; String m = scanner . next ( ) ; boolean flag = true ; int index = 0 ; for ( int i = 0 ; i < n . length ( ) ; i ++ ) { if ( n . charAt ( i ) == ' * ' ) { index = i ; flag = false ; break ; } }   if ( flag ) { if ( n . equals ( m ) ) { System . out . println ( " YES " ) ; } else { System . out . println ( " NO " ) ; } } else { String temp1 = n . substring ( 0 , index ) ; String temp2 = n . substring ( index + 1 ) ; if ( temp1 . length ( ) + temp2 . length ( ) > m . length ( ) ) { System . out . println ( " NO " ) ; return ; } String temp3 = m . substring ( 0 , temp1 . length ( ) ) ; String temp4 = m . substring ( m . length ( ) - temp2 . length ( ) ) ; if ( temp3 . equals ( temp1 ) && temp4 . equals ( temp2 ) ) { System . out . println ( " YES " ) ; } else { System . out . println ( " NO " ) ; } } } }


import java . io . * ;   import java . util . * ; public class Solution { public static void main ( String [ ] args ) throws Exception { FastReader fr = new FastReader ( ) ; int n = fr . nextInt ( ) ; int m = fr . nextInt ( ) ; String s = fr . next ( ) ; String t = fr . next ( ) ; boolean contains = false ; int idx = - 1 ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { if ( s . charAt ( i ) == ' * ' ) { contains = true ; idx = i ; } } if ( ! contains ) { if ( n != m || ! s . equals ( t ) ) System . out . println ( " NO " ) ; else System . out . println ( " YES " ) ; } else { if ( m < ( n - 1 ) ) System . out . println ( " NO " ) ; else { if ( m == n - 1 ) { int j = 0 ; boolean pos = true ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { if ( s . charAt ( i ) == ' * ' ) continue ; if ( s . charAt ( i ) != t . charAt ( j ) ) { pos = false ; break ; } j ++ ; } if ( pos ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; } else { boolean pos = true ; for ( int i = 0 ; i < idx ; i ++ ) { if ( s . charAt ( i ) != t . charAt ( i ) ) { pos = false ; break ; } } if ( pos == false ) System . out . println ( " NO " ) ; else { int j = m - 1 ; for ( int i = n - 1 ; i > idx ; i -- ) { if ( s . charAt ( i ) != t . charAt ( j ) ) { pos = false ; break ; } j -- ; } if ( pos == true ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; } } } } } public static boolean check ( String s ) {


import java . io . * ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . List ; import java . util . StringTokenizer ; public class realfast implements Runnable { private static final int INF = ( int ) 1e9 ; public void solve ( ) throws IOException { int n = readInt ( ) ; int m = readInt ( ) ; if ( n > m ) { int val = n ; n = m ; m = val ; } if ( n != 2 && n % 2 == 0 ) { out . println ( ( n / 2 ) * ( m ) ) ; } else if ( n != 1 && n % 2 == 1 ) { long val = n / 2 ; long val1 = ( m ) ; val = val * val1 ; val = val + ( m + 1 ) / 2 ; out . println ( val ) ; } else { if ( n == 1 ) out . println ( m ) ; else if ( n == 2 ) { if ( m % 2 == 0 ) { if ( m % 4 == 0 ) out . println ( m ) ; else out . println ( m + 2 ) ; } else out . println ( m + 1 ) ; } }   }

s = input ( ) . split ( ) n = int ( s [ 0 ] ) m = int ( s [ 1 ] ) if ( n > m ) : a = n n = m m = aif ( n == 1 ) : print ( m ) elif ( n == 2 ) : if ( m % 4 <= 2 ) : print ( m + m % 4 ) else : print ( m + 1 ) else : print ( ( n * m + 1 ) // 2 ) NEW_LINE


n , m = map ( int , input ( ) . split ( ) )   if n > m :   n , m = m , n   if n > 2 and m > 2 :   print ( ( ( n * m ) + 1 ) // 2 )   elif n == 1 :   print ( m )   else :   print ( 2 * ( ( ( m // 4 ) * 2 ) + min ( m % 4 , 2 ) ) )           NEW_LINE


def voevoda ( n , m ) : if n == 1 : return m if n == 2 : return ( m - m % 4 ) + 2 * min ( m % 4 , 2 ) return ( n * m + 1 ) // 2     N , M = sorted ( [ int ( i ) for i in input ( ) . split ( ) ] ) print ( voevoda ( N , M ) ) NEW_LINE


def li ( ) : return list ( map ( int , input ( ) . split ( " ▁ " ) ) ) n , m = li ( ) if n < m : t = n n = m m = tif m == 1 : print ( n ) elif m == 2 : print ( 2 * ( 2 * ( n // 4 ) + min ( n % 4 , 2 ) ) ) else : print ( ( n * m ) - ( n * m ) // 2 ) NEW_LINE


import java . io . * ; import java . util . * ;   public class MainClass { public static void main ( String [ ] args ) throws IOException { Reader in = new Reader ( ) ; int n = in . nextInt ( ) ; int m = in . nextInt ( ) ; int ans = 0 ; int min = Math . min ( m , n ) ; int max = Math . max ( m , n ) ; if ( min == 1 ) ans = max ; else if ( min == 2 ) ans = ( max / 4 ) * 4 + Math . min ( max % 4 , 2 ) * 2 ; else ans = ( m * n ) - ( m * n ) / 2 ; System . out . println ( ans ) ; } } class Reader { final private int BUFFER_SIZE = 1 << 16 ; private DataInputStream din ; private byte [ ] buffer ; private int bufferPointer , bytesRead ;   public Reader ( ) { din = new DataInputStream ( System . in ) ; buffer = new byte [ BUFFER_SIZE ] ; bufferPointer = bytesRead = 0 ; }   public Reader ( String file_name ) throws IOException { din = new DataInputStream ( new FileInputStream ( file_name ) ) ; buffer = new byte [ BUFFER_SIZE ] ; bufferPointer = bytesRead = 0 ; }   public String readLine ( ) throws IOException { byte [ ] buf = new byte [ 64 ] ;


# include < iostream > # include < string > # include < algorithm > # include < cmath > # include < queue > # define iof ios :: sync_with_stdio ( false ) using namespace std ; const int maxn = 105 ; int X [ maxn ] [ maxn ] ; int n , m , k ; struct op { int a , b , c , d ; } q [ maxn * maxn ] ; void cl ( int x ) { int te = X [ x ] [ m ] ; for ( int i = m ; i >= 2 ; i -- ) X [ x ] [ i ] = X [ x ] [ i - 1 ] ; X [ x ] [ 1 ] = te ; } void cr ( int x ) { int te = X [ n ] [ x ] ; for ( int i = n ; i >= 2 ; i -- ) X [ i ] [ x ] = X [ i - 1 ] [ x ] ; X [ 1 ] [ x ] = te ; } void ad ( int x , int y , int z ) { X [ x ] [ y ] = z ; } int main ( ) { cin >> n >> m >> k ; for ( int i = 1 ; i <= k ; i ++ ) { cin >> q [ i ] . a ; if ( q [ i ] . a == 1 || q [ i ] . a == 2 ) cin >> q [ i ] . b ; if ( q [ i ] . a == 3 ) cin >> q [ i ] . b >> q [ i ] . c >> q [ i ] . d ; } for ( int i = k ; i >= 1 ; i -- ) { switch ( q [ i ] . a ) { case 1 : cl ( q [ i ] . b ) ; break ; case 2 : cr ( q [ i ] . b ) ; break ; case 3 : ad ( q [ i ] . b , q [ i ] . c , q [ i ] . d ) ; } } for ( int i = 1 ; i <= n ; i ++ ) { for ( int j = 1 ; j <= m ; j ++ ) printf ( " % d ▁ " , X [ i ] [ j ] ) ; printf ( " \n " ) ; } return 0 ; }

f = lambda : map ( int , input ( ) . split ( ) ) n , m , q = f ( ) p = [ [ 0 ] * m for j in range ( n ) ] for t in [ list ( f ( ) ) for k in range ( q ) ] [ : : - 1 ] : j = t [ 1 ] - 1 if t [ 0 ] == 1 : p [ j ] . insert ( 0 , p [ j ] . pop ( ) ) elif t [ 0 ] == 2 : s = p [ - 1 ] [ j ] for i in range ( n - 1 , 0 , - 1 ) : p [ i ] [ j ] = p [ i - 1 ] [ j ] p [ 0 ] [ j ] = s else : p [ j ] [ t [ 2 ] - 1 ] = t [ 3 ] for d in p : print ( * d ) NEW_LINE


f = lambda : map ( int , input ( ) . split ( ) )   n , m , q = f ( )   p = [ [ 0 ] * m for j in range ( n ) ]   for t in [ list ( f ( ) ) for k in range ( q ) ] [ : : - 1 ] :   j = t [ 1 ] - 1   if t [ 0 ] == 1 : p [ j ] . insert ( 0 , p [ j ] . pop ( ) )   elif t [ 0 ] == 2 :     s = p [ - 1 ] [ j ]   for i in range ( n - 1 , 0 , - 1 ) : p [ i ] [ j ] = p [ i - 1 ] [ j ]   p [ 0 ] [ j ] = s   else : p [ j ] [ t [ 2 ] - 1 ] = t [ 3 ]   for d in p : print ( * d )         NEW_LINE


f = lambda : map ( int , input ( ) . split ( ) )   n , m , q = f ( )   p = [ [ 0 ] * m for j in range ( n ) ]   for t in [ list ( f ( ) ) for k in range ( q ) ] [ :: - 1 ] :   j = t [ 1 ] - 1   if t [ 0 ] == 1 : p [ j ] . insert ( 0 , p [ j ] . pop ( ) )   elif t [ 0 ] == 2 :   s = p [ - 1 ] [ j ]   for i in range ( n - 1 , 0 , - 1 ) : p [ i ] [ j ] = p [ i - 1 ] [ j ]   p [ 0 ] [ j ] = s   else : p [ j ] [ t [ 2 ] - 1 ] = t [ 3 ]   for d in p : print ( * d )     # Made By Mostafa_Khaled


import java . util . Scanner ;   public class LittleArtemandMatrix {   public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) , m = scan . nextInt ( ) , q = scan . nextInt ( ) ; int [ ] [ ] a = new int [ n ] [ m ] ; int [ ] [ ] c = new int [ q ] [ 4 ] ; for ( int i = 0 ; i < q ; i ++ ) { int cc = scan . nextInt ( ) ; c [ i ] [ 0 ] = cc ; if ( cc < 3 ) c [ i ] [ 1 ] = scan . nextInt ( ) ; else for ( int j = 1 ; j <= 3 ; j ++ ) c [ i ] [ j ] = scan . nextInt ( ) ; } for ( int i = q - 1 ; i >= 0 ; i -- ) { if ( c [ i ] [ 0 ] < 3 ) { if ( c [ i ] [ 0 ] == 1 ) {


import java . util . * ; import java . io . * ;   public class New_Year_And_Old_Property {   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 ) {

a , b = map ( int , input ( ) . split ( ) ) print ( len ( [ ( 2 ** i - 1 ) - 2 ** j for i in range ( 65 ) for j in range ( i - 1 ) if a <= 2 ** i - 1 - 2 ** j <= b ] ) ) NEW_LINE


a , b = map ( int , input ( ) . split ( ) ) cnt = 0 for i in range ( 2 , 65 ) : num = ( 1 << i ) - 1 pow = 1 for j in range ( i - 1 ) : cur = num - pow if cur >= a and cur <= b : cnt += 1 pow <<= 1 print ( cnt ) NEW_LINE


from math import logfrom math import ceila , b = map ( int , input ( ) . split ( ) ) chislo = 1 mno = 1 ans = 0 flag = 1 while flag : flag = 0 chi = 1 m = 1 if chislo <= b : flag = 1 for _ in range ( 1 , ceil ( log ( chislo , 2 ) ) ) : m *= 2 if chislo - chi <= b or chislo - chi <= a : flag = 1 if chislo - chi >= a and chislo - chi <= b : ans += 1 chi += m - m // 2 mno *= 2 chislo += mnoprint ( ans ) NEW_LINE


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


import java . util . * ; import java . io . * ;    public class Solution { public static void solve ( long a , long b ) { int i = 0 ; long count = 0 ; while ( ( 1l << i ) / 2 <= b ) { int j = 0 ; while ( ( 1l << j ) < ( 1l << i ) / 2 ) { long x = ( ( 1l << i ) - 1 ) - ( 1l << j ) ; if ( x >= a && x <= b ) count ++ ; j ++ ; } i ++ ; } System . out . println ( count ) ; } public static void main ( String args [ ] ) throws Exception { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String [ ] in = br . readLine ( ) . trim ( ) . split ( " ▁ " ) ; solve ( Long . parseLong ( in [ 0 ] ) , Long . parseLong ( in [ 1 ] ) ) ; } }


import java . util . * ; import java . lang . * ; import java . math . * ; import java . io . * ; import java . util . HashSet ; import java . util . Arrays ; import java . util . Scanner ; import java . util . Set ; import java . util . ArrayList ; import java . util . Collections ; import java . util . Arrays ; import java . util . HashMap ; import java . util . Map ; import java . text . DecimalFormat ; import java . lang . Math ; import java . util . Iterator ; import java . util . TreeSet ; import java . io . BufferedOutputStream ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . math . BigDecimal ; import java . util . * ; public class D1343 { public static PrintWriter out = new PrintWriter ( new BufferedOutputStream ( System . out ) ) ; static long MOD = ( long ) ( 1e9 + 7 ) ; static FastReader sc = new FastReader ( ) ; static int pInf = Integer . MAX_VALUE ; static int nInf = Integer . MIN_VALUE ; public static void main ( String [ ] args ) { int test = 1 ; while ( test -- > 0 ) { long a = sc . nextLong ( ) ; long b = sc . nextLong ( ) ; long p = 0 ; long t = b ; while ( t > 0 ) { p ++ ; t = t >> 1 ; } int count = 0 ; boolean flag = false ; for ( long i = p ; i >= 0 ; i -- ) { for ( long j = 0 ; j < i - 1 ; j ++ ) { long x = ( ( 1L << i ) - 1 ) - ( 1L << j ) ; if ( x >= a && x <= b ) { count ++ ; } } } out . println ( count ) ; } out . close ( ) ; } public static long mul ( long a , long b ) { return ( ( a % MOD ) * ( b % MOD ) ) % MOD ; } public static long add ( long a , long b ) { return ( ( a % MOD ) + ( b % MOD ) ) % MOD ; }


import java . io . IOException ; import java . util . * ; import java . util . Arrays ; import java . util . Scanner ;   public class Bit_year { public static void main ( String [ ] args ) throws IOException { Scanner sc = new Scanner ( System . in ) ; long n = sc . nextLong ( ) ; long m = sc . nextLong ( ) ; String s1 = Long . toBinaryString ( n ) ; String s2 = Long . toBinaryString ( m ) ; int diff = s2 . length ( ) - s1 . length ( ) ;   int ans = 0 ; while ( diff >= 0 ) { char [ ] a1 = new char [ s1 . length ( ) + diff ] ; Arrays . fill ( a1 , '1' ) ; for ( int i = a1 . length - 1 ; i > 0 ; i -- ) { a1 [ i ] = '0' ; if ( a1 . length > 16 ) { long k = Long . parseLong ( new String ( a1 ) , 2 ) ;


import java . io . BufferedReader ; import java . io . FileReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Scanner ; import java . util . StringTokenizer ; import java . util . * ; import java . io . * ; public class codeforces { static class Student { int x , y ; Student ( int x , int y ) { this . x = x ; this . y = y ;

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


n , m , k = map ( int , input ( ) . split ( ) ) a = sorted ( map ( int , input ( ) . split ( ) ) , reverse = True ) b = sorted ( map ( int , input ( ) . split ( ) ) , reverse = True ) cou = ind = 0 l = min ( m , n ) aa = max ( b ) for i in range ( l ) : if a [ i ] > b [ i ] : cou += 1 ind = max ( ind , a [ i ] )   if m >= n and cou > 0 : print ( " YES " ) elif m < n : print ( " YES " ) else : print ( " NO " )                           NEW_LINE


import sysfrom math import gcd , sqrt , ceilfrom collections import defaultdict , Counter , dequefrom bisect import bisect_left , bisect_rightimport mathfrom itertools import permutations   NEW_LINE


import java . io . * ; import java . util . * ; import java . math . * ; public class Main {   public void solve ( ) throws IOException {   int n = in . nextInt ( ) ; int m = in . nextInt ( ) ; int k = in . nextInt ( ) ;   int [ ] aa = new int [ n ] ; int [ ] bb = new int [ m ] ;   for ( int i = 0 ; i < n ; i ++ ) { aa [ i ] = in . nextInt ( ) ; }   for ( int i = 0 ; i < m ; i ++ ) { bb [ i ] = in . nextInt ( ) ; }


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


import java . io . * ; import java . util . StringTokenizer ;   public class CardsNumber { public static void main ( String [ ] args ) throws IOException { File f = new File ( " input . txt " ) ; FileReader fileReader = new FileReader ( f ) ; BufferedReader reader = new BufferedReader ( fileReader ) ;   int n = Integer . parseInt ( reader . readLine ( ) ) ; StringBuilder sb = new StringBuilder ( ) ;   StringTokenizer st = new StringTokenizer ( reader . readLine ( ) ) ;   int [ ] [ ] number = new int [ 5001 ] [ 2 ] ;   for ( int i = 1 ; i <= 2 * n ; i ++ ) { int temp = Integer . parseInt ( st . nextToken ( ) ) ;   if ( number [ temp ] [ 0 ] > 0 ) { sb . append ( number [ temp ] [ 1 ] + " ▁ " + i + " \n " ) ; number [ temp ] [ 0 ] = 0 ; } else { number [ temp ] [ 0 ] ++ ; number [ temp ] [ 1 ] = i ; } }   FileWriter writer = new FileWriter ( " output . txt " ) ;   for ( int i = 1 ; i < 5001 ; i ++ ) { if ( number [ i ] [ 0 ] > 0 ) { sb = new StringBuilder ( ) ; sb . append ( " - 1" ) ; break ; } }   writer . write ( String . valueOf ( sb ) ) ;   writer . close ( ) ; } }

f = open ( " input . txt " , " r " ) text = f . readlines ( ) f . close ( )   n = int ( text [ 0 ] )   cards = [ int ( c ) for c in text [ 1 ] . split ( ) ]   f = open ( " output . txt " , " w " )   dicti = { }   for bruh in sorted ( set ( cards ) ) : dicti [ bruh ] = [ ]   for i , j in enumerate ( cards ) : dicti [ j ] . append ( str ( i + 1 ) )   for k in dicti : v = dicti [ k ] if len ( v ) % 2 == 1 : f . write ( str ( - 1 ) ) exit ( ) for k1 in dicti : v1 = dicti [ k1 ] f . write ( ' ▁ ' . join ( v1 ) ) f . write ( ' \n ' )   f . close ( )     NEW_LINE


l = list ( map ( int , open ( " input . txt " ) . read ( ) . split ( ) [ 1 : ] ) ) s = set ( l ) f = open ( " output . txt " , ' w ' ) ans = [ ] dict = { } for i in range ( len ( l ) ) : if l [ i ] not in dict . keys ( ) : dict [ l [ i ] ] = i + 1 else : ans . append ( str ( dict [ l [ i ] ] ) + " ▁ " + str ( i + 1 ) ) del dict [ l [ i ] ] if len ( dict ) == 0 : f . write ( ' \n ' . join ( ans ) ) else : f . write ( " - 1" ) NEW_LINE


inf = open ( " input . txt " , ' r ' ) ouf = open ( " output . txt " , ' w ' ) n = int ( inf . readline ( ) ) l = list ( map ( int , inf . readline ( ) . split ( ) ) ) d = dict ( )   for j , i in enumerate ( l ) : if i in d : d [ i ] += [ j + 1 ] else : d [ i ] = [ j + 1 ]   ans = [ ]   for i in d : if len ( d [ i ] ) % 2 != 0 : ouf . write ( str ( - 1 ) + " \n " ) break ans += d [ i ] else : for i in range ( 0 , len ( ans ) , 2 ) : ouf . write ( str ( ans [ i ] ) + " ▁ " + str ( ans [ i + 1 ] ) + " \n " ) NEW_LINE


inp , out = open ( ' input . txt ' , ' r ' ) , open ( ' output . txt ' , ' w ' ) n = int ( inp . readline ( ) ) a = inp . readline ( ) . split ( ) b = { } s = [ ] for i in range ( 1 , 2 * n + 1 ) : e = int ( a [ i - 1 ] ) if not e in b : b [ e ] = i else : s . append ( str ( b [ e ] ) + ' ▁ ' + str ( i ) ) del ( b [ e ] ) if len ( b ) == 0 : out . write ( ' \n ' . join ( s ) ) else : out . write ( ' - 1' ) out . close ( ) NEW_LINE


import java . io . * ; import java . util . ArrayList ; import java . util . StringTokenizer ;   public class CardsNumber { public static void main ( String [ ] args ) throws IOException { File f = new File ( " input . txt " ) ; FileReader fileReader = new FileReader ( f ) ; BufferedReader reader = new BufferedReader ( fileReader ) ;   int n = Integer . parseInt ( reader . readLine ( ) ) ; String s = " " ;   StringTokenizer st = new StringTokenizer ( reader . readLine ( ) ) ;   int [ ] [ ] number = new int [ 5001 ] [ 2 ] ; ArrayList < Integer > pair = new ArrayList < > ( ) ;   for ( int i = 1 ; i <= 2 * n ; i ++ ) { int temp = Integer . parseInt ( st . nextToken ( ) ) ;   if ( number [ temp ] [ 0 ] > 0 ) { pair . add ( number [ temp ] [ 1 ] ) ; pair . add ( i ) ; number [ temp ] [ 0 ] = 0 ; } else { number [ temp ] [ 0 ] ++ ; number [ temp ] [ 1 ] = i ; } }   FileWriter writer = new FileWriter ( " output . txt " ) ;   boolean flag = true ; for ( int i = 1 ; i < 5001 ; i ++ ) { if ( number [ i ] [ 0 ] > 0 ) { flag = false ; break ; } }   if ( flag ) { for ( int i = 0 ; i < 2 * n ; i += 2 ) { writer . write ( pair . get ( i ) + " ▁ " + pair . get ( i + 1 ) + " \n " ) ; } } else writer . write ( " - 1" ) ;   writer . close ( ) ; } }


import java . io . * ; import java . io . BufferedReader ; import java . io . IOException ; import java . util . * ;   public class A254 { public static void main ( String [ ] args ) throws IOException { FileReader fin = new FileReader ( " input . txt " ) ; BufferedReader bin = new BufferedReader ( fin ) ; FileWriter fout = new FileWriter ( " output . txt " ) ; BufferedWriter bout = new BufferedWriter ( fout ) ; PrintWriter pout = new PrintWriter ( bout ) ; String num = bin . readLine ( ) ; int n = Integer . valueOf ( num ) ; String txt = bin . readLine ( ) ; String [ ] val = txt . split ( " \\ s + " ) ;


import java . io . BufferedReader ; import java . io . File ; import java . io . FileReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . ArrayList ; import java . util . HashMap ; import java . util . List ; import java . util . Map ; import java . util . StringTokenizer ;   public class A254 {   public static void main ( String [ ] args ) throws IOException { BufferedReader reader = new BufferedReader ( new FileReader ( " input . txt " ) ) ; int N = Integer . parseInt ( reader . readLine ( ) ) ; Map < Integer , List < Integer > > map = new HashMap < Integer , List < Integer > > ( ) ; StringTokenizer tokenizer = new StringTokenizer ( reader . readLine ( ) ) ; for ( int n = 0 ; n < 2 * N ; n ++ ) { int a = Integer . parseInt ( tokenizer . nextToken ( ) ) ; map . computeIfAbsent ( a , key -> new ArrayList < Integer > ( ) ) . add ( n + 1 ) ; } PrintWriter out = new PrintWriter ( new File ( " output . txt " ) ) ; StringBuilder output = new StringBuilder ( ) ; for ( List < Integer > list : map . values ( ) ) { if ( list . size ( ) % 2 == 0 ) { int i = 0 ; while ( i < list . size ( ) ) { output . append ( list . get ( i ++ ) ) . append ( ' ▁ ' ) . append ( list . get ( i ++ ) ) . append ( ' \n ' ) ; } } else { out . println ( " - 1" ) ; out . close ( ) ; return ; } } out . print ( output ) ; out . close ( ) ; }   }


import java . io . BufferedReader ; import java . io . FileInputStream ; import java . io . FileNotFoundException ; import java . io . FileOutputStream ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . Scanner ; import java . util . Vector ; public class A { public static void main ( String [ ] args ) throws NumberFormatException , IOException { BufferedReader in = new BufferedReader ( new InputStreamReader ( System . in ) ) ; PrintWriter out = new PrintWriter ( System . out ) ; in = new BufferedReader ( new InputStreamReader ( new FileInputStream ( " input . txt " ) ) ) ; out = new PrintWriter ( new FileOutputStream ( " output . txt " ) ) ; int n = Integer . parseInt ( in . readLine ( ) ) ; String [ ] inp = in . readLine ( ) . split ( " ▁ " ) ; Vector < Vector < Integer > > mas = new Vector < Vector < Integer > > ( ) ; for ( int i = 0 ; i < 5001 ; i ++ ) { mas . add ( new Vector < Integer > ( ) ) ; } for ( int i = 0 ; i < n * 2 ; i ++ ) { mas . get ( Integer . parseInt ( inp [ i ] ) ) . add ( i + 1 ) ; } boolean check = true ; for ( int i = 1 ; i < 5001 ; i ++ ) { if ( mas . get ( i ) . size ( ) % 2 == 1 ) { check = false ; break ; } } if ( ! check ) { out . println ( - 1 ) ; } else { for ( int i = 1 ; i < 5001 ; i ++ ) { for ( int j = 0 ; j < mas . get ( i ) . size ( ) ; j += 2 ) { out . println ( mas . get ( i ) . get ( j ) + " ▁ " + mas . get ( i ) . get ( j + 1 ) ) ; } } } out . close ( ) ; } }


import java . util . * ; import java . io . * ;   public class A1145 { private StreamTokenizer in ; private PrintWriter out ;   public static void main ( String [ ] args ) throws IOException { new A1145 ( ) . run ( ) ; }   private void run ( ) throws IOException { in = new StreamTokenizer ( new BufferedReader ( new InputStreamReader ( System . in ) ) ) ; out = new PrintWriter ( System . out ) ;   execute ( ) ;   out . flush ( ) ; }   private void execute ( ) throws IOException { final int n = nextInt ( ) ; final int [ ] arr = new int [ n ] ;   for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = nextInt ( ) ; }   final int length = solve ( arr , 0 , arr . length ) ; out . print ( length ) ; }   public int solve ( int [ ] arr , int start , int end ) throws IOException { if ( end - start < 2 ) { return 1 ; }   if ( isSorted ( arr , start , end ) ) { return end - start ; }   final int middle = start + ( end - start ) / 2 ;   final int leftLength = solve ( arr , start , middle ) ; final int rightLength = solve ( arr , middle , end ) ;   return Math . max ( leftLength , rightLength ) ; }   private boolean isSorted ( int [ ] arr , int start , int end ) { final int [ ] original = Arrays . copyOfRange ( arr , start , end ) ; final int [ ] subArray = Arrays . copyOf ( original , original . length ) ;   Arrays . sort ( subArray ) ;   return Arrays . equals ( original , subArray ) ; }    private String nextString ( ) throws IOException { in . nextToken ( ) ;   return in . sval ; }   private long nextLong ( ) throws IOException { in . nextToken ( ) ;   return ( long ) in . nval ; }   private int nextInt ( ) throws IOException { in . nextToken ( ) ;   return ( int ) in . nval ; } }

from sys import stdin , stdoutfrom math import floor , gcd , fabs , factorial , fmod , sqrt , inf , logfrom collections import defaultdict as dd , dequefrom heapq import merge , heapify , heappop , heappush , nsmallestfrom bisect import bisect_left as bl , bisect_right as br , bisect mod = pow ( 10 , 9 ) + 7 mod2 = 998244353 def inp ( ) : return stdin . readline ( ) . strip ( ) def iinp ( ) : return int ( inp ( ) ) def out ( var , end = " \n " ) : stdout . write ( str ( var ) + " \n " ) def outa ( * var , end = " \n " ) : stdout . write ( ' ▁ ' . join ( map ( str , var ) ) + end ) def lmp ( ) : return list ( mp ( ) ) def mp ( ) : return map ( int , inp ( ) . split ( ) ) def smp ( ) : return map ( str , inp ( ) . split ( ) ) def l1d ( n , val = 0 ) : return [ val for i in range ( n ) ] def l2d ( n , m , val = 0 ) : return [ l1d ( m , val ) for j in range ( n ) ] def remadd ( x , y ) : return 1 if x % y else 0 def ceil ( a , b ) : return ( a + b - 1 ) // b def isprime ( x ) : if x <= 1 : return False if x in ( 2 , 3 ) : return True if x % 2 == 0 : return False for i in range ( 3 , int ( sqrt ( x ) ) + 1 , 2 ) : if x % i == 0 : return False return True n = iinp ( ) arr = lmp ( ) tn = nflg = Truewhile flg : for i in range ( 0 , n , tn ) : if arr [ i : i + tn ] == sorted ( arr [ i : i + tn ] ) : flg = False break if flg : tn //= 2 print ( tn ) NEW_LINE


ans = 0   def is_sorted ( array , l , r ) : for i in range ( l , r ) : if array [ i ] > array [ i + 1 ] : return False return True   def check_array ( array , l , r ) : if is_sorted ( array , l , r ) : global ans ans = max ( ans , r - l + 1 ) return   mid = ( l + r ) // 2 check_array ( array , l , mid ) check_array ( array , mid + 1 , r )   n = int ( input ( ) ) array = list ( map ( ( int ) , input ( ) . strip ( ) . split ( ) ) ) size = len ( array ) check_array ( array , 0 , size - 1 ) print ( ans ) NEW_LINE


def sol ( a , i , j ) : if ( len ( a ) == 1 ) : return True for i in range ( i + 1 , j + 1 ) : if ( a [ i ] < a [ i - 1 ] ) : return False return Truedef solve ( a , i , j ) : if ( i > j ) : return 0 ; if ( sol ( a , i , j ) ) : return j - i + 1 mid = ( j + i ) // 2 return max ( solve ( a , i , mid ) , solve ( a , mid + 1 , j ) ) n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) print ( solve ( a , 0 , len ( a ) - 1 ) ) NEW_LINE


def check_thanossort ( arr , x , y ) : t = 0 for i in range ( x + 1 , y + 1 ) : if ( arr [ i ] >= arr [ i - 1 ] ) : t += 1 if ( t == y - x ) : p = 1 else : p = 0 return pa = int ( input ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) j = awhile ( j >= 1 ) : k = 0 brk = False while ( k < a ) : if ( check_thanossort ( arr , k , k + j - 1 ) == 1 ) : ans = j ; brk = True ; break k += j if ( brk ) : break j //= 2 print ( ans ) NEW_LINE


import sysinput = sys . stdin . readline   def is_sorted ( a , n ) : if n == 1 : return 1 flag = 1 for i in range ( 1 , n ) : if a [ i - 1 ] > a [ i ] : flag = 0 return flag   def f ( a , n ) : if is_sorted ( a , n ) : return n return max ( f ( a [ : n // 2 ] , n // 2 ) , f ( a [ n // 2 : ] , n // 2 ) )   t = 1   for _ in range ( t ) : n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) ans = f ( a , n ) print ( ans ) NEW_LINE


import java . util . Scanner ;   public class p1145A { 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 ( ) ; boolean ok = false ; for ( int len = n ; len > 0 ; len /= 2 ) { for ( int c = 0 ; c < n ; c += len ) { boolean sorted = true ; for ( int i = 1 ; i < len ; ++ i ) if ( a [ c + i ] < a [ c + i - 1 ] ) sorted = false ; if ( sorted ) { System . out . println ( len ) ; ok = true ; break ; } } if ( ok ) break ; }   } }


import java . util . * ; import java . io . * ; public class Main { private static int thanos ( int [ ] input ) { if ( input . length == 1 ) { return 1 ; } if ( sorted ( input ) ) { return input . length ; } int l [ ] = new int [ input . length / 2 ] ; int r [ ] = new int [ input . length / 2 ] ; for ( int i = 0 ; i < input . length / 2 ; i ++ ) { l [ i ] = input [ i ] ; } for ( int i = input . length / 2 ; i < input . length ; i ++ ) { r [ i - input . length / 2 ] = input [ i ] ; } int left = thanos ( l ) ; int right = thanos ( r ) ; return left > right ? left : right ; }    private static boolean sorted ( int [ ] input ) { for ( int i = 0 ; i < input . length - 1 ; i ++ ) { if ( input [ i ] > input [ i + 1 ] ) { return false ; } } return true ; }   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int arr [ ] = new int [ n ] ; for ( int j = 0 ; j < arr . length ; j ++ ) { arr [ j ] = sc . nextInt ( ) ; } System . out . println ( thanos ( arr ) ) ; } }


import java . util . * ;   public class file {   private static final Scanner sc = new Scanner ( System . in ) ;   private static void foo ( ) { int n = sc . nextInt ( ) , count1 = 0 , max = 1 , istrue = 0 ; int [ ] arr = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = sc . nextInt ( ) ; } System . out . println ( maxsort ( arr , 0 , n - 1 ) ) ; }   private static int maxsort ( int [ ] arr , int i , int j ) { int count = 1 ; for ( int k = i ; k <= j ; ) { if ( k + 1 <= j && arr [ k ] <= arr [ k + 1 ] ) { k ++ ; count ++ ; } else { break ; } } if ( count == j - i + 1 ) return count ; else return Math . max ( maxsort ( arr , i + ( j - i + 1 ) / 2 , j ) , maxsort ( arr , i , j - ( j - i + 1 ) / 2 ) ) ; }    public static void main ( String [ ] args ) {