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 x = fr . nextInt ( ) ; int a [ ] = new int [ n ] ; boolean two = false ; Set < Integer > set = new HashSet < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = fr . nextInt ( ) ; if ( set . contains ( a [ i ] ) ) two = true ; set . add ( a [ i ] ) ; } if ( two == true ) { System . out . println ( 0 ) ; } else { boolean pos = true ; int temp [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { temp [ i ] = ( a [ i ] & x ) ; } Set < Integer > set2 = new HashSet < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { set2 . add ( temp [ i ] ) ; }

import java . util . * ;   public class CodeForces1013B { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int n = scan . nextInt ( ) , x = scan . nextInt ( ) ; HashSet < Integer > set1 = new HashSet < > ( ) , set2 = new HashSet < > ( ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { int t = scan . nextInt ( ) ; set1 . add ( t ) ; a [ i ] = t ; } if ( set1 . size ( ) != n ) { System . out . println ( 0 ) ; return ; } for ( int i = 0 ; i < n ; i ++ ) { int tmp = a [ i ] & x ; set2 . add ( tmp ) ; if ( tmp != a [ i ] && set1 . contains ( tmp ) ) { System . out . println ( 1 ) ; return ; } } System . out . println ( set2 . size ( ) == n ? - 1 : 2 ) ; } }

import java . util . * ; public class a { static int mod = ( int ) 1e9 + 7 ; static int Infinity = Integer . MAX_VALUE ; static int negInfinity = Integer . MIN_VALUE ; public static void main ( String args [ ] ) { Scanner d = new Scanner ( System . in ) ; int n , x , i , z ; n = d . nextInt ( ) ; x = d . nextInt ( ) ; int a [ ] = new int [ n ] ; Set < Integer > s = new HashSet < > ( ) ; Set < Integer > s1 = new HashSet < > ( ) ; for ( i = 0 ; i < n ; i ++ ) a [ i ] = d . nextInt ( ) ; z = - 1 ; for ( i = 0 ; i < n ; i ++ ) { if ( s . isEmpty ( ) ) { s . add ( a [ i ] ) ; s1 . add ( a [ i ] & x ) ; } else if ( s . contains ( a [ i ] ) ) { z = 0 ; } else if ( s . contains ( a [ i ] & x ) || s1 . contains ( a [ i ] ) ) { if ( z != 0 ) { z = 1 ; s . add ( a [ i ] ) ; } } else { s . add ( a [ i ] ) ; s1 . add ( a [ i ] & x ) ; } } if ( s1 . size ( ) < s . size ( ) && z == - 1 ) System . out . println ( 2 ) ; else System . out . println ( z ) ; } }

import java . io . * ; import java . util . * ;   public class _500B implements Runnable { public static void main ( String [ ] args ) { new Thread ( null , new _500B ( ) , " Main " , 1 << 27 ) . start ( ) ; } @ Override public void run ( ) { FastReader fd = new FastReader ( System . in ) ; PrintWriter out = new PrintWriter ( System . out ) ; int n = fd . nextInt ( ) ; int x = fd . nextInt ( ) ; int [ ] data = getArray ( n , false , fd ) ; HashSet < Integer > val1 = new HashSet < > ( ) , val2 = new HashSet < > ( ) ; int ans = Integer . MAX_VALUE ; HashMap < Integer , Integer > mapper = new HashMap < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( mapper . containsKey ( data [ i ] ) ) { out . println ( 0 ) ; out . close ( ) ; return ; } mapper . put ( data [ i ] , i ) ; } HashMap < Integer , Integer > andedMap = new HashMap < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { int anded = data [ i ] & x ; if ( mapper . containsKey ( anded ) && mapper . get ( anded ) != i ) { out . println ( 1 ) ; out . close ( ) ; return ; } andedMap . put ( anded , andedMap . getOrDefault ( anded , 0 ) + 1 ) ; } for ( int i : andedMap . values ( ) ) { if ( i > 1 ) { out . println ( 2 ) ; out . close ( ) ; return ; } }   out . println ( - 1 ) ; out . close ( ) ; }

import sysfrom collections import Counter   def main ( ) : _ , x , * l = map ( int , sys . stdin . read ( ) . strip ( ) . split ( ) ) s , c = set ( l ) , Counter ( ) if len ( s ) < len ( l ) : return 0 for i in l : a = i & x if a in s and a != i : return 1 c [ a ] += 1 if c . most_common ( ) [ 0 ] [ 1 ] > 1 : return 2 return - 1 print ( main ( ) ) NEW_LINE

if __name__ == ' _ _ main _ _ ' : n , x = map ( int , input ( ) . split ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) vis = { } for i in range ( n ) : vis . setdefault ( a [ i ] , 0 ) vis [ a [ i ] ] += 1   if max ( vis . values ( ) ) > 1 : print ( 0 ) NEW_LINE

import functoolsimport timefrom collections import Counter   def timer ( func ) : @ functools . wraps ( func ) def wrapper ( * args , ** kwargs ) : stime = time . perf_counter ( ) res = func ( * args , ** kwargs ) elapsed = time . perf_counter ( ) - stime print ( f " { func . _ _ name _ _ } ▁ in ▁ { elapsed : .4f } ▁ secs " ) return res return wrapper   class solver : NEW_LINE

n , x = [ int ( x ) for x in input ( ) . split ( ) ] li = set ( [ * map ( int , input ( ) . split ( ) ) ] ) b = set ( li ) c = set ( li ) if len ( li ) < n : print ( 0 ) quit ( ) for i in li : if i & x != i and i & x in li : print ( 1 ) quit ( ) a = set ( aa & x for aa in li ) if len ( a ) < n : print ( 2 ) quit ( ) print ( - 1 ) NEW_LINE

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 , x = mp ( ) arr = lmp ( ) if len ( set ( arr ) ) < n : print ( 0 ) else : flg = True md = dd ( int ) for i in arr : md [ i ] += 1 for i in arr : if i & x != i and md [ i & x ] > 0 : print ( 1 ) flg = False break if flg : nl = [ ] for i in arr : nl . append ( i & x ) if len ( set ( nl ) ) < n : flg = False print ( 2 ) if flg : print ( - 1 ) NEW_LINE


import java . io . * ; import java . util . StringTokenizer ;   public class _173A implements Runnable { private BufferedReader in ; private StringTokenizer tok ;   private Object solve ( ) throws IOException { int n = nextInt ( ) ; String a = nextToken ( ) , b = nextToken ( ) ; int m = a . length ( ) , k = b . length ( ) , lcm = ( k * m ) / gcd ( k , m ) , r = n % lcm , ac = 0 , bc = 0 , ar = 0 , br = 0 ; for ( int i = 0 , lim = Math . min ( n , lcm ) ; i < lim ; i ++ ) { char ax = a . charAt ( i % m ) , bx = b . charAt ( i % k ) ; if ( ax == ' R ' ) { if ( bx == ' S ' ) { ac ++ ; } else if ( bx == ' P ' ) { bc ++ ; } } else if ( ax == ' S ' ) { if ( bx == ' P ' ) { ac ++ ; } else if ( bx == ' R ' ) { bc ++ ; } } else { if ( bx == ' R ' ) { ac ++ ; } else if ( bx == ' S ' ) { bc ++ ; } } if ( i + 1 == r ) { ar = ac ; br = bc ; } } ac = ac * ( n / lcm ) + ar ; bc = bc * ( n / lcm ) + br ; return bc + " ▁ " + ac ; }   private static int gcd ( int x , int y ) { return y == 0 ? x : gcd ( y , x % y ) ; }

import java . io . BufferedWriter ; import java . io . IOException ; import java . io . InputStream ; import java . io . OutputStreamWriter ; import java . math . BigDecimal ;    import java . util . ArrayDeque ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . Collections ; import java . util . HashMap ; import java . util . Locale ; import java . util . Map . Entry ; import java . util . PriorityQueue ; import java . util . TreeSet ;     public final class CF_Croc_2012_A { static boolean verb = true ; static void log ( Object X ) { if ( verb ) System . err . println ( X ) ; } static void log ( Object [ ] X ) { if ( verb ) { for ( Object U : X ) System . err . print ( U + " ▁ " ) ; System . err . println ( " " ) ; } } static void log ( int [ ] X ) { if ( verb ) { for ( int U : X ) System . err . print ( U + " ▁ " ) ; System . err . println ( " " ) ; } } static void log ( double [ ] X ) { if ( verb ) { for ( double U : X ) System . err . print ( U + " ▁ " ) ; System . err . println ( " " ) ; } } static void logWln ( Object X ) { if ( verb ) System . err . print ( X ) ; } static void info ( Object o ) { System . out . println ( o ) ; } static void output ( Object o ) { outputWln ( " " + o + " \n " ) ; } static void outputWln ( Object o ) { try { out . write ( " " + o ) ; } catch ( Exception e ) { } }   static int pgcd ( int a , int b ) { if ( a < b ) return pgcd ( b , a ) ; while ( b != 0 ) { int c = a % b ; a = b ; b = c ; } return a ; }

import mathdef lcm ( x , y ) : if x > y : z = x else : z = y while ( True ) : if ( ( z % x == 0 ) and ( z % y == 0 ) ) : lcm = z break z += 1 return lcmNikif = 0 Policarf = 0 games = int ( input ( ) ) Nikiffs_sequence = str ( input ( ) ) Policarf_sequence = str ( input ( ) ) def solution ( Nikif , Policarf , games , Nikiffs_sequence , Policarf_sequence ) : Policarf_sequence = list ( Policarf_sequence ) Nikiffs_sequence = list ( Nikiffs_sequence ) NEW_LINE

def gcd ( a , b ) : if b == 0 : return a return gcd ( b , a % b )     def counter ( s , t , r ) : k , m = len ( s ) , len ( t ) p , q = 0 , 0 for i in range ( r ) : if s [ i % k ] == ' P ' : if t [ i % m ] == ' S ' : q += 1 elif t [ i % m ] == ' R ' : p += 1 elif s [ i % k ] == ' R ' : if t [ i % m ] == ' S ' : p += 1 elif t [ i % m ] == ' P ' : q += 1 else : if t [ i % m ] == ' P ' : p += 1 elif t [ i % m ] == ' R ' : q += 1 return p , q     n = int ( input ( ) ) s = input ( ) t = input ( ) k , m = len ( s ) , len ( t ) r = k * m // gcd ( k , m ) p , q = counter ( s , t , r ) p1 , q1 = counter ( s , t , n % r ) print ( q * ( n // r ) + q1 , p * ( n // r ) + p1 ) NEW_LINE

n = int ( input ( ) )   aa , bb = 0 , 0 a = list ( input ( ) ) b = list ( input ( ) ) rp = [ ] i = 0 while ( 1 ) : if a [ i % len ( a ) ] == " R " : if b [ i % len ( b ) ] == " P " : bb += 1 elif b [ i % len ( b ) ] == " S " : aa += 1 elif a [ i % len ( a ) ] == " P " : if b [ i % len ( b ) ] == " R " : aa += 1 elif b [ i % len ( b ) ] == " S " : bb += 1 else : if b [ i % len ( b ) ] == " R " : bb += 1 elif b [ i % len ( b ) ] == " P " : aa += 1   i += 1 rp . append ( ( bb , aa ) ) if ( i % len ( a ) == 0 and i % len ( b ) == 0 ) or i > n : break   if len ( rp ) == n : print ( bb , aa ) else : w = n // len ( rp ) ww = n % len ( rp ) if ww == 0 : print ( bb * w , aa * w ) else : print ( bb * w + rp [ ww - 1 ] [ 0 ] , aa * w + rp [ ww - 1 ] [ 1 ] )   NEW_LINE


# include < iostream > # include < string > # include < algorithm > using namespace std ; int main ( ) { int n ; string a ; cin >> n >> a ; sort ( a . begin ( ) , a . end ( ) ) ; cout << a ; return 0 ; }

import java . util . * ; import java . io . * ;   public class Oh_Those_Palindromes {   static class FastReader { BufferedReader br ; StringTokenizer st ;   public FastReader ( ) { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; }   String next ( ) { while ( st == null || ! st . hasMoreElements ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; }   int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; }   long nextLong ( ) { return Long . parseLong ( next ( ) ) ; }   double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; }   String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; }   }   public static void shuffle ( int [ ] a ) { Random r = new Random ( ) ;   for ( int i = 0 ; i <= a . length - 2 ; i ++ ) { int j = i + r . nextInt ( a . length - i ) ;   swap ( a , i , j ) ; } }   public static void swap ( int [ ] a , int i , int j ) { int temp = a [ i ] ; a [ i ] = a [ j ] ; a [ j ] = temp ; }   public static void main ( String [ ] args ) {

import java . util . * ; import java . math . BigInteger ; public class asd { static Scanner s = new Scanner ( System . in ) ; public static void main ( String args [ ] ) throws Exception { int t = 1 ; while ( t -- > 0 ) { solve ( ) ; } } public static void solve ( ) { int n = s . nextInt ( ) ; String str = s . next ( ) ; char ch [ ] = new char [ n ] ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) ch [ i ] = str . charAt ( i ) ; Arrays . sort ( ch ) ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) System . out . print ( ch [ i ] ) ; } }

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 . lang . reflect . Array ; import java . text . DecimalFormat ; import java . util . * ; import java . io . * ;   public class Equal {    static class pair implements Comparable < pair > { int x ; int y ;   public pair ( int u , int v ) { this . x = u ; this . y = v ; }   @ Override public int compareTo ( pair o ) { if ( x == o . x ) { return y - o . y ; } return x - o . x ; } }   static double dis ( pair a , pair b ) { return Math . sqrt ( ( ( a . x - b . x ) * ( a . x - b . x ) ) + ( ( a . y - b . y ) * ( a . y - b . y ) ) ) ; }   static int c ; static int d ; static int e ;   static void extendedEuclid ( int a , int b ) { if ( b == 0 ) { c = 1 ; d = 0 ; e = a ; return ; } extendedEuclid ( b , a % b ) ; int x1 = d ; int y1 = c - ( a / b ) * d ; c = x1 ; d = y1 ; } static int [ ] rank ; static int [ ] p ; static int sets ; static int findSet ( int i ) { return ( p [ i ] == i ) ? i : ( p [ i ] = findSet ( p [ i ] ) ) ; } static boolean isSameSet ( int i , int j ) { return findSet ( i ) == findSet ( j ) ; } static void unionSet ( int i , int j ) { if ( ! isSameSet ( i , j ) ) { sets -- ; int x = findSet ( i ) ; int y = findSet ( j ) ; if ( rank [ x ] > rank [ y ] ) p [ y ] = x ; else { p [ x ] = y ; if ( rank [ x ] == rank [ y ] ) rank [ y ] ++ ; } } } static class SegmentTree {

import java . io . BufferedWriter ; import java . io . ByteArrayInputStream ; import java . io . FileInputStream ; import java . io . FileWriter ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . InputMismatchException ; import java . util . List ;   public class Main { private static final long MOD = ( long ) 1e9 + 7 ; static InputStream is ; static PrintWriter out ; static String INPUT = " " ; static int lenbuf = 0 , ptrbuf = 0 ; private static byte [ ] inbuf = new byte [ 1024 ] ; static boolean readFile = false ;

import java . util . Arrays ; import java . util . HashSet ; import java . util . List ; import java . util . Scanner ;   public class Meeting {   public static void main ( String [ ] args ) {

import java . awt . Point ; import java . util . ArrayList ; import java . util . List ; import java . util . Scanner ;   public class B144 {   public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int xFrom = in . nextInt ( ) ; int yFrom = in . nextInt ( ) ; int xTo = in . nextInt ( ) ; int yTo = in . nextInt ( ) ; if ( xFrom > xTo ) { int temp = xFrom ; xFrom = xTo ; xTo = temp ; } if ( yFrom > yTo ) { int temp = yFrom ; yFrom = yTo ; yTo = temp ; } int N = in . nextInt ( ) ; int [ ] X = new int [ N ] ; int [ ] Y = new int [ N ] ; int [ ] R = new int [ N ] ; for ( int n = 0 ; n < N ; n ++ ) { X [ n ] = in . nextInt ( ) ; Y [ n ] = in . nextInt ( ) ; R [ n ] = in . nextInt ( ) ; } List < Point > generals = new ArrayList < > ( ) ; for ( int x = xFrom ; x < xTo ; x ++ ) { generals . add ( new Point ( x , yFrom ) ) ; } for ( int y = yFrom ; y < yTo ; y ++ ) { generals . add ( new Point ( xTo , y ) ) ; } for ( int x = xTo ; x > xFrom ; x -- ) { generals . add ( new Point ( x , yTo ) ) ; } for ( int y = yTo ; y > yFrom ; y -- ) { generals . add ( new Point ( xFrom , y ) ) ; } int answer = 0 ; for ( Point p : generals ) { boolean heated = false ; for ( int n = 0 ; n < N ; n ++ ) { int dx = p . x - X [ n ] ; int dy = p . y - Y [ n ] ; if ( dx * dx + dy * dy <= R [ n ] * R [ n ] ) { heated = true ; break ; } } if ( ! heated ) { answer ++ ; } } System . out . println ( answer ) ; }   }

x1 , y1 , x2 , y2 = [ int ( ele ) for ele in input ( ) . strip ( ) . split ( ) ] num_rad = int ( input ( ) . strip ( ) ) radiators = [ ]   def euclid ( c1 , c2 ) : return ( ( c1 [ 0 ] - c2 [ 0 ] ) ** 2 + ( c1 [ 1 ] - c2 [ 1 ] ) ** 2 ) ** 0.5   for i in range ( num_rad ) : x , y , r = [ int ( ele ) for ele in input ( ) . strip ( ) . split ( ) ] radiators . append ( [ ( x , y ) , r ] )   table_coords = sorted ( [ ( x1 , y1 ) , ( x2 , y2 ) , ( x1 , y2 ) , ( x2 , y1 ) ] ) general_coords = table_coordsfor x in range ( table_coords [ 0 ] [ 0 ] + 1 , table_coords [ 2 ] [ 0 ] ) : general_coords . append ( ( x , y1 ) ) general_coords . append ( ( x , y2 ) )   for y in range ( table_coords [ 0 ] [ 1 ] + 1 , table_coords [ 3 ] [ 1 ] ) : general_coords . append ( ( x1 , y ) ) general_coords . append ( ( x2 , y ) )   num_blankets = 0 for gen in general_coords : flag = 0 for radiator , radius in radiators : if euclid ( gen , radiator ) <= radius : flag = 1 break if flag == 0 : num_blankets += 1   print ( num_blankets ) NEW_LINE

xa , ya , xb , yb = [ int ( i ) for i in input ( ) . split ( ) ] l = [ ] cnt = ( abs ( xa - xb ) + 1 ) * 2 + ( abs ( ya - yb ) - 1 ) * 2 x1 , x2 , y1 , y2 = min ( xa , xb ) , max ( xa , xb ) , min ( ya , yb ) , max ( ya , yb ) for i in range ( x1 , x2 + 1 ) : for j in range ( y1 , y2 + 1 ) : if i == x1 or i == x2 or j == y1 or y2 == j : l . append ( [ i , j ] ) rad = [ ] t = int ( input ( ) ) for i in range ( t ) : x , y , r = list ( map ( int , input ( ) . split ( ) ) ) rad . append ( [ x , y , r ] ) i , j = len ( l ) - 1 , len ( rad ) - 1 while i >= 0 : x = l [ i ] [ 0 ] - rad [ j ] [ 0 ] y = l [ i ] [ 1 ] - rad [ j ] [ 1 ] if x ** 2 + y ** 2 <= rad [ j ] [ 2 ] ** 2 : cnt -= 1 i -= 1 j = len ( rad ) - 1 else : if j >= 0 : j -= 1 else : i -= 1 j = len ( rad ) - 1 print ( cnt ) NEW_LINE

def f ( i , t , Y , c ) : arr , res = [ ( t , t ) ] , 0 for x , y , r in c : d = r - ( y - Y ) ** 2 if d < 0 : continue d = int ( d ** .5 ) arr . append ( ( x - d , x + d + 1 ) ) for a , b in sorted ( arr ) : if i < a and i < t : res += a - i if i < b : i = b return res   NEW_LINE

def f ( i , t , Y , c ) : arr , res = [ ( t , t ) ] , 0 for x , y , r in c : d = r - ( y - Y ) ** 2 if d < 0 : continue d = int ( d ** .5 ) arr . append ( ( x - d , x + d + 1 ) ) for a , b in sorted ( arr ) : if i < a and i < t : res += a - i if i < b : i = b return res xa , ya , xb , yb = map ( int , input ( ) . split ( ) ) if xa > xb : xa , xb = xb , xaif ya > yb : ya , yb = yb , yan = int ( input ( ) ) arr = [ map ( int , input ( ) . split ( ) ) for _ in range ( n ) ] arr1 = [ ( x , y , r * r ) for x , y , r in arr ] arr2 = [ ( y , x , r ) for x , y , r in arr1 ] res1 = f ( xa , xb + 1 , ya , arr1 ) res2 = f ( xa , xb + 1 , yb , arr1 ) res3 = f ( ya + 1 , yb , xa , arr2 ) res4 = f ( ya + 1 , yb , xb , arr2 ) print ( res1 + res2 + res3 + res4 ) NEW_LINE

import sys , math     def ints_input ( ) : return [ int ( i ) for i in sys . stdin . readline ( ) . strip ( " \n " ) . split ( " ▁ " ) ]     def print_list ( arr ) : sys . stdout . writelines ( str ( x ) + " ▁ " for x in arr ) sys . stdout . write ( " \n " )     def fast_input ( type = str ) : return type ( sys . stdin . readline ( ) . strip ( " \n " ) )     x1 , y1 , x2 , y2 = ints_input ( ) xa = min ( x1 , x2 ) xb = max ( x1 , x2 ) ya = min ( y1 , y2 ) yb = max ( y1 , y2 ) n = fast_input ( int ) r = [ ] for i in range ( n ) : r . append ( tuple ( ints_input ( ) ) ) ans = 0 for i in range ( xa , xb + 1 ) : for j in range ( ya , yb + 1 ) : if xa < i < xb and ya < j < yb : continue if all ( math . sqrt ( ( i - k [ 0 ] ) ** 2 + ( j - k [ 1 ] ) ** 2 ) > k [ 2 ] for k in r ) : ans += 1                           print ( ans ) NEW_LINE


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

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


import java . util . * ;   public class StackBracket { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] ar = new int [ n + 1 ] ; for ( int i = 1 ; i <= n ; i ++ ) { ar [ i ] = sc . nextInt ( ) ; } Arrays . sort ( ar ) ; long sum1 = 0 ; long sum2 = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { if ( i < ( n + 1 - i ) ) { sum1 += ar [ i ] ; sum2 += ar [ n + 1 - i ] ; } else if ( i == ( n + 1 - i ) ) { sum2 += ar [ n + 1 - i ] ; } } long sum = sum1 * sum1 + sum2 * sum2 ; System . out . println ( sum ) ;   }   public static boolean strive ( String s ) { Stack < Character > stack = new Stack < > ( ) ; stack . push ( s . charAt ( 0 ) ) ; for ( int i = 1 ; i < s . length ( ) ; i ++ ) { char ch1 = s . charAt ( i ) ; if ( ch1 == ' ) ' ) { if ( ! stack . isEmpty ( ) && stack . peek ( ) == ' ( ' ) { stack . pop ( ) ; } else { return false ; } } else { stack . push ( ' ( ' ) ; } } return stack . size ( ) == 0 ; }   public static int getAns ( int [ ] ar , int bigger , int [ ] [ ] dp , int i , int j ) {   if ( i < 0 || j < 0 ) { return 0 ; }    if ( dp [ i ] [ j ] != - 1 ) { return dp [ i ] [ j ] ; } int ans1 = 0 , ans2 = 0 , ans3 = 0 ;   if ( ar [ i ] < bigger ) { ans1 = 1 + getAns ( ar , ar [ i ] , dp , i - 1 , j ) ;

import java . util . * ;    public class Practise {

import java . util . * ; import java . lang . * ; import java . io . * ; public class Main { PrintWriter out ; FastReader sc ; long mod = ( long ) ( 1e9 + 7 ) ; long maxlong = Long . MAX_VALUE ; long minlong = Long . MIN_VALUE ; public void sol ( ) { long n = ni ( ) ; long [ ] ar = new long [ ( int ) n ] ; for ( long i = 0 ; i < n ; i ++ ) { ar [ ( int ) i ] = ni ( ) ; } sort ( ar ) ; long p = n / 2 , a = 0 , b = 0 ; for ( long i = 0 ; i < p ; i ++ ) { a += ar [ ( int ) i ] ; } for ( long i = p ; i < n ; i ++ ) { b += ar [ ( int ) i ] ; } pl ( a * a + b * b ) ; } public static void main ( String [ ] args ) { Main g = new Main ( ) ; g . out = new PrintWriter ( System . out ) ; g . sc = new FastReader ( ) ; int t = 1 ;

num = int ( input ( ) ) arr = sorted ( map ( int , input ( ) . split ( ) ) )   x = sum ( arr [ : num // 2 ] ) y = sum ( arr [ num // 2 : ] )   ans = x ** 2 + y ** 2   print ( ans )     NEW_LINE

n = int ( input ( ) ) li = list ( map ( int , input ( ) . split ( ) ) ) li . sort ( ) i = 0j = n - 1 w = 0 h = 0 if n == 1 : print ( li [ 0 ] ** 2 ) else : while i < j : h += li [ i ] w += li [ j ] i += 1 j -= 1 if i == j : w += li [ i ] break print ( h ** 2 + w ** 2 ) 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 . io . FileInputStream ; import java . io . FileNotFoundException ; import java . io . IOException ; import java . io . PrintWriter ; import java . util . Arrays ; import java . util . Collection ; import java . util . List ; import java . util . Scanner ; import java . util . function . Function ; import java . util . stream . Collectors ; public class _p000910A { static public void main ( final String [ ] args ) throws IOException { p000910A . _main ( args ) ; }

import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int len = sc . nextInt ( ) ; int jump = sc . nextInt ( ) ; String str = sc . next ( ) ; int pos = 0 ; int ans = 0 ; while ( pos < len - 1 ) { int i = jump ; if ( pos + i > len - 1 ) { i = len - 1 - pos ; } while ( str . charAt ( pos + i ) == '0' ) { i -- ; } if ( i == 0 ) { ans = - 1 ; break ; } ans ++ ; pos += i ; } System . out . println ( ans ) ; }   }

import java . util . * ; import java . io . * ; import java . lang . * ;   public class Solution { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int d = sc . nextInt ( ) ; String s = sc . next ( ) ; int jump = 0 ; boolean b = false ; for ( int i = 0 ; i < n ; ) { int t = i ; if ( s . charAt ( i ) == '0' ) break ; for ( int j = i + d ; j > i ; j -- ) { if ( j < n && s . charAt ( j ) == '1' ) { i = j ;

n , d = map ( int , input ( ) . split ( ) ) s = input ( ) if max ( list ( len ( i ) for i in s . split ( '1' ) ) ) >= d : print ( - 1 ) else : ans = 0 i = 0 while i < n - 1 : for j in range ( min ( n - 1 , i + d ) , i , - 1 ) : if s [ j ] == '1' : ans += 1 i = j break print ( ans ) NEW_LINE

nd = input ( ) . split ( ) n = int ( nd [ 0 ] ) d = int ( nd [ 1 ] ) s = input ( ) dp = [ - 1 ] * ndp [ 0 ] = 0   for i in range ( 1 , n ) : if s [ i ] == '0' : dp [ i ] = - 1 else : dp [ i ] = 999999999 for j in range ( 1 , d + 1 ) : if j > i : break if dp [ i ] > dp [ i - j ] and dp [ i - j ] > - 1 : dp [ i ] = dp [ i - j ] dp [ i ] += 1   if dp [ n - 1 ] == 1000000000 : print ( - 1 ) else : print ( dp [ n - 1 ] ) NEW_LINE

n , d = ( int ( x ) for x in input ( ) . strip ( ) . split ( ' ▁ ' ) ) s = input ( )   flag = Trueres = 0 weizhi = 0   if n - 1 <= d : print ( "1" ) else : while flag : weizhi = weizhi + d   if weizhi >= n - 1 : res = res + 1 flag = False else : for i in range ( d ) : if s [ weizhi ] == "1" : break else : weizhi = weizhi - 1 if i == d - 1 : res = - 2 flag = False res = res + 1 print ( res ) NEW_LINE

n , d = map ( int , input ( ) . split ( ) ) s = input ( ) i = 0 c = 0 while i < n - 1 : j = i i = min ( n - 1 , i + d ) while s [ i ] == '0' : i -= 1 if i == j : print ( - 1 ) exit ( ) c += 1 print ( c ) NEW_LINE


import java . util . Scanner ;   public class _0717HappyBirthdayPolycarp { static long gen ( int n ) { String s = " " ; for ( int i = 0 ; i < n && s . length ( ) < n ; i ++ ) { s += s + "1" ; }

import java . util . * ;   public class Main { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; int t = input . nextInt ( ) ;

r = lambda : list ( map ( int , input ( ) . split ( ) ) ) t = int ( input ( ) ) for _ in range ( t ) : n = int ( input ( ) ) c = 0 for i in range ( 1 , 10 ) : j = 1 while int ( str ( i ) * j ) <= n : c += 1 j += 1   print ( c ) NEW_LINE

x = int ( input ( ) ) for i in range ( x ) : n = int ( input ( ) ) s = 0 k = 1 for j in range ( 1 , 11 ) : for h in range ( 1 , 10 ) : if ( h * k <= n ) : s = s + 1 k = ( k * 10 ) + 1 print ( s ) NEW_LINE

from math import log10 , floor   for _ in range ( int ( input ( ) ) ) : count = 0   n = int ( input ( ) ) L = floor ( log10 ( n ) ) + 1   for i in [ '1' , '2' , '3' , '4' , '5' , '6' , '7' , '8' , '9' ] : for l in range ( 1 , 1 + L ) : x = int ( i * l ) if x <= n : count += 1   print ( count ) NEW_LINE

for _ in range ( int ( input ( ) ) ) : n = int ( input ( ) ) tmp = 0 for i in range ( 1 , 10 ) : k = i while k <= n : tmp += 1 k = k * 10 + i print ( tmp ) 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 ( ) ; for ( int j = 0 ; j < t ; j ++ ) { int n = s . nextInt ( ) ; int k = s . nextInt ( ) ; int c = n - k ; c = c + k / 2 ; System . out . println ( c ) ; for ( int i = k + 1 ; i <= n ; i ++ ) { System . out . print ( i + " ▁ " ) ; } for ( int i = k - 1 ; i >= ( k + 1 ) / 2 ; i -- ) { System . out . print ( i + " ▁ " ) ; } System . out . println ( ) ; } } }

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

import java . util . Scanner ; public class A { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int t = in . nextInt ( ) ; while ( t -- > 0 ) { int n = in . nextInt ( ) ; int k = in . nextInt ( ) ; System . out . println ( n - k + k / 2 ) ; for ( int q = ( k + 1 ) / 2 ; q < k ; q ++ ) System . out . printf ( " % d ▁ " , q ) ; for ( int q = k + 1 ; q <= n ; q ++ ) System . out . printf ( " % d ▁ " , q ) ; System . out . println ( ) ; } in . close ( ) ; } }

import java . util . Scanner ; public class Problem1493A { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; while ( t -- > 0 ) { int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; int ans = ( n - k ) + k / 2 ; System . out . println ( ans ) ; for ( int i = k + 1 ; i <= n ; ++ i ) { System . out . print ( i + " ▁ " ) ; } for ( int i = ( k + 1 ) / 2 ; i < k ; ++ i ) { System . out . print ( i + " ▁ " ) ; System . out . println ( ) ; } } } }

import java . util . * ; public class Q1 { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int t = in . nextInt ( ) ; while ( t -- > 0 ) { int n = in . nextInt ( ) ; int k = in . nextInt ( ) ; int st = ( int ) Math . ceil ( ( double ) k / 2 ) ; int size = n - st ; System . out . println ( size ) ; for ( int i = st ; i <= n ; i ++ ) { if ( i != k ) System . out . print ( i + " ▁ " ) ; } if ( size > 0 ) System . out . println ( ) ; } } }

for s in [ * open ( 0 ) ] [ 1 : ] : n , k = map ( int , s . split ( ) ) ; print ( n - k + k // 2 , * range ( k + 1 >> 1 , k ) , * range ( k + 1 , n + 1 ) ) NEW_LINE

for _ in range ( int ( input ( ) ) ) : NEW_LINE INDENT n , k = map ( int , input ( ) . split ( ) ) NEW_LINE a = [ i for i in range ( 1 , n + 1 ) if i != k and ( i > k or 2 * i >= k ) ] NEW_LINE print ( len ( a ) , " \n " , * a ) NEW_LINE DEDENT

for s in [ * open ( 0 ) ] [ 1 : ] : n , k = map ( int , s . split ( ) ) ; k += 1 ; print ( n - k // 2 , * range ( k >> 1 , k - 1 ) , * range ( k , n + 1 ) ) NEW_LINE


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

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

n , k , m = map ( int , input ( ) . split ( ) ) S = list ( map ( str , input ( ) . split ( ) ) ) toid = { } for i , s in enumerate ( S ) : toid [ s ] = iA = list ( map ( int , input ( ) . split ( ) ) ) dmin = { } INF = 10 ** 18 for i in range ( k ) : temp = list ( map ( int , input ( ) . split ( ) ) ) res = INF for j in temp [ 1 : ] : res = min ( res , A [ j - 1 ] ) for j in temp [ 1 : ] : dmin [ j - 1 ] = resT = list ( map ( str , input ( ) . split ( ) ) ) ans = 0 for t in T : ans += dmin [ toid [ t ] ] print ( ans ) NEW_LINE

from collections import defaultdictclass DisjSet : def __init__ ( self ) : self . rank = defaultdict ( lambda : 1 ) self . parent = defaultdict ( lambda : - 1 ) def find ( self , x ) : if self . parent [ x ] == - 1 or self . parent [ x ] == x : self . parent [ x ] = x else : self . parent [ x ] = self . find ( self . parent [ x ] ) return self . parent [ x ]                       def Union ( self , x , y ) :     xset = self . find ( x ) yset = self . find ( y )       if xset == yset : return   if self . rank [ xset ] < self . rank [ yset ] : self . parent [ xset ] = yset     elif self . rank [ xset ] > self . rank [ yset ] : self . parent [ yset ] = xset     else : self . parent [ yset ] = xset self . rank [ xset ] = self . rank [ xset ] + 1 self . parent [ y ] = xn , k , m = map ( int , input ( ) . split ( ) ) arr = list ( input ( ) . split ( ) ) cost = list ( map ( int , input ( ) . split ( ) ) ) obj = DisjSet ( ) cnt = defaultdict ( lambda : None ) for _ in range ( k ) : temp = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE

n , k , m = map ( int , input ( ) . split ( ) ) a = list ( map ( str , input ( ) . split ( ) ) ) l = list ( map ( int , input ( ) . split ( ) ) ) dict = { } for i in range ( k ) : lst = list ( input ( ) . split ( ) ) c = list ( map ( int , lst [ 1 : ] ) ) mini = min ( [ l [ i - 1 ] for i in c ] ) for i in c : l [ i - 1 ] = minifor i in range ( n ) : dict [ a [ i ] ] = l [ i ] r = list ( map ( str , input ( ) . split ( ) ) ) ans = 0 for i in range ( m ) : ans += dict [ r [ i ] ] print ( ans ) NEW_LINE


import java . util . * ; import java . io . * ; import java . math . * ;   public class x809B { static BufferedReader infile ; public static void main ( String hi [ ] ) throws Exception { infile = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( infile . readLine ( ) ) ; N = Integer . parseInt ( st . nextToken ( ) ) ; st . nextToken ( ) ;

import java . io . * ; import java . util . * ;   public class GladToSeeYou { static Scanner sc = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; int i = search1 ( 0 , n ) ; int j = search1 ( 0 , i - 1 ) ; if ( j == 0 || ! query ( j , i ) ) j = search2 ( i , n ) ; System . out . println ( "2 ▁ " + i + " ▁ " + j ) ; } public static boolean query ( int x , int y ) { System . out . println ( "1 ▁ " + x + " ▁ " + y ) ; return sc . next ( ) . equals ( " TAK " ) ; } public static int search1 ( int x , int y ) { int low = x ; int high = y ; while ( low + 1 < high ) { int i = ( low + high ) / 2 ; if ( query ( i , i + 1 ) ) high = i ; else low = i ; } return high ; } public static int search2 ( int x , int y ) { int low = x ; int high = y ; while ( low + 1 < high ) { int i = ( low + high ) / 2 ; if ( query ( i + 1 , i ) ) low = i ; else high = i ; } return high ; } }

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

def query ( x , y ) : print ( 1 , x , y ) ans = input ( ) return ans == " TAK "   def solve ( L , R ) : while L < R : M = ( L + R ) // 2 if query ( M , M + 1 ) : R = M else : L = M + 1 return L     N , K = map ( int , input ( ) . split ( ) )   a = solve ( 1 , N ) if a == 1 : print ( 2 , a , solve ( 2 , N ) ) exit ( 0 ) if a == N : print ( 2 , a , solve ( 1 , N - 1 ) ) exit ( 0 )   b = solve ( 1 , a - 1 ) if query ( b , a ) == False : b = solve ( a + 1 , N ) print ( 2 , a , b ) NEW_LINE

def get ( l , r ) : print ( 1 , l , r ) return input ( ) == ' TAK ' def f ( l , r ) : while l < r : m = ( l + r ) >> 1 if get ( m , m + 1 ) : r = m else : l = m + 1 return ln , k = map ( int , input ( ) . split ( ) ) x = f ( 1 , n ) y = f ( 1 , x - 1 ) if x == y or not get ( y , x ) : y = f ( x + 1 , n ) print ( 2 , x , y ) exit ( ) NEW_LINE

import sysimport math   line = lambda : map ( int , input ( ) . split ( ) )   def ask ( x , y ) : print ( 1 , x , y ) sys . stdout . flush ( ) return input ( ) == " TAK "   def divide ( l , r ) : d = r - l + 1 if d == 1 : return l m = ( l + r ) // 2 if ask ( m , m + 1 ) : return divide ( l , m ) else : return divide ( m + 1 , r )   def solve ( ) : n , k = line ( ) x = divide ( 1 , n ) y = x z = x if x > 1 : y = divide ( 1 , x - 1 ) if x < n : z = divide ( x + 1 , n ) if ask ( y , z ) == False : y , z = z , y if x == y : y , z = z , y print ( 2 , x , y ) sys . stdout . flush ( ) def main ( ) : solve ( ) exit ( 0 )   if __name__ == " _ _ main _ _ " : main ( ) NEW_LINE

import sys     def chek ( x , y ) : print ( 1 , int ( x ) , int ( y ) ) sys . stdout . flush ( ) return input ( ) == ' TAK '     def binp ( l , r ) : if l == r : return l while l < r : m = ( l + r ) // 2 if chek ( m , m + 1 ) : r = m else : l = m + 1 return int ( l )     n , k = list ( map ( int , input ( ) . split ( ) ) ) x = binp ( 1 , n ) y1 , y2 = x , xif x > 1 : y1 = binp ( 1 , x - 1 ) if x < n : y2 = binp ( x + 1 , n ) if not chek ( y1 , y2 ) : y1 , y2 = y2 , y1if x == y1 : y1 , y2 = y2 , y1print ( 2 , x , y1 ) sys . stdout . flush ( ) NEW_LINE


import java . util . * ; import java . io . * ; import java . math . * ;   public class Main { public static void main ( String ... args ) throws IOException { Scanner sc = new Scanner ( new BufferedReader ( new InputStreamReader ( System . in ) ) ) ; PrintWriter out = new PrintWriter ( System . out ) ; int x = sc . nextInt ( ) , y = sc . nextInt ( ) ; long [ ] arr = new long [ 4 ] ; arr [ 0 ] = arr [ 3 ] = Math . abs ( x ) + Math . abs ( y ) ; if ( x < 0 ) arr [ 0 ] = - arr [ 0 ] ; if ( y < 0 ) arr [ 3 ] = - arr [ 3 ] ; if ( arr [ 0 ] < arr [ 2 ] ) out . println ( arr [ 0 ] + " ▁ " + arr [ 1 ] + " ▁ " + arr [ 2 ] + " ▁ " + arr [ 3 ] ) ; else out . println ( arr [ 2 ] + " ▁ " + arr [ 3 ] + " ▁ " + arr [ 0 ] + " ▁ " + arr [ 1 ] ) ; out . flush ( ) ; out . close ( ) ; } }

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 . math . BigInteger ; 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 ) ; long x = input . nextLong ( ) ; long y = input . nextLong ( ) ; if ( x > 0 && y > 0 ) { System . out . println ( "0 ▁ " + ( x + y ) + " ▁ " + ( x + y ) + " ▁ " + 0 ) ; } else if ( x > 0 && y < 0 ) { y = - y ; System . out . println ( "0 ▁ " + ( - ( x + y ) ) + " ▁ " + ( x + y ) + " ▁ " + 0 ) ; } else if ( x < 0 && y > 0 ) { x = - x ; System . out . println ( ( - ( x + y ) ) + " ▁ 0 ▁ 0 ▁ " + ( x + y ) ) ; } else if ( x < 0 && y < 0 ) { x = - x ; y = - y ; System . out . println ( ( - ( x + y ) ) + " ▁ 0 ▁ 0 ▁ " + ( - ( x + y ) ) ) ; } }   }

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

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

import java . util . * ; import java . util . Scanner ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int x = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; int x1 = 0 ; int y1 = 0 ; int x2 = 0 ; int y2 = 0 ; if ( x < 0 ) x1 = ( int ) ( - 1 * Math . abs ( x ) + - 1 * Math . abs ( y ) ) ; else x1 = ( int ) ( Math . abs ( x ) + Math . abs ( y ) ) ; y1 = 0 ; if ( y < 0 ) y2 = ( int ) ( - 1 * Math . abs ( x ) + - 1 * Math . abs ( y ) ) ; else y2 = ( int ) ( Math . abs ( x ) + Math . abs ( y ) ) ; x2 = 0 ;   if ( x1 < x2 ) System . out . print ( x1 + " ▁ " + y1 + " ▁ " + x2 + " ▁ " + y2 ) ; else System . out . print ( x2 + " ▁ " + y2 + " ▁ " + x1 + " ▁ " + y1 ) ; } }

x , y = map ( int , input ( ) . split ( ) ) a , b = 0 , 0 if x > 0 : if y > 0 : a = x + y else : a = x + - 1 * yelse : if y > 0 : a = x + - 1 * y else : a = x + yif y > 0 : if x > 0 : b = x + y else : b = y + - 1 * xelse : if x > 0 : b = - 1 * x + y else : b = x + yif a < 0 : print ( a , 0 , 0 , b ) else : print ( 0 , b , a , 0 ) NEW_LINE

x , y = map ( int , input ( ) . split ( ) ) ans = abs ( x ) + abs ( y )   if x > 0 and y > 0 : print ( 0 , ans , ans , 0 ) if x < 0 and y > 0 : print ( - ans , 0 , 0 , ans ) if x < 0 and y < 0 : print ( - ans , 0 , 0 , - ans ) if x > 0 and y < 0 : print ( 0 , - ans , ans , 0 ) NEW_LINE

x , y = map ( int , input ( ) . split ( ) )   dx = - 1 if x < 0 else 1 dy = - 1 if y < 0 else 1 v = abs ( x ) + abs ( y ) x1 = min ( 0 , v * dx ) y1 = v * dy if x1 == 0 else 0x2 = max ( 0 , v * dx ) y2 = v * dy if x2 == 0 else 0   print ( x1 , y1 , x2 , y2 ) NEW_LINE

x , y = map ( int , input ( ) . split ( ) ) m = 1 if x * y < 0 else - 1 c = y - m * xprint ( - 1 * c // m , 0 , 0 , c ) if - 1 * c // m < 0 else print ( 0 , c , - 1 * c // m , 0 ) NEW_LINE


import java . util . * ; public class Main { public static Scanner heba = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { int n = heba . nextInt ( ) ; int [ ] clms = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) clms [ i ] = heba . nextInt ( ) ; int [ ] cnts = new int [ n ] ;

import java . io . * ; import java . util . * ;   public class B {   private void solve ( ) throws IOException { int n = nextInt ( ) ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = nextInt ( ) ; } int ans = 0 ; for ( int k = 0 ; k < n ; k ++ ) { int l = k ; while ( l > 0 && a [ l ] >= a [ l - 1 ] ) l -- ; int r = k ; while ( r < n - 1 && a [ r ] >= a [ r + 1 ] ) r ++ ; ans = Math . max ( ans , r - l + 1 ) ; } out . println ( ans ) ; }   public static void main ( String [ ] args ) { new B ( ) . run ( ) ; }   BufferedReader br ; StringTokenizer st ; PrintWriter out ; boolean eof = false ;   public void run ( ) { Locale . setDefault ( Locale . US ) ; try { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; out = new PrintWriter ( System . out ) ; st = new StringTokenizer ( " " ) ; solve ( ) ; out . close ( ) ; } catch ( Throwable e ) { e . printStackTrace ( ) ; System . exit ( 239 ) ; } }   String nextToken ( ) throws IOException { while ( ! st . hasMoreTokens ( ) ) { String line = br . readLine ( ) ; if ( line == null ) { eof = true ; line = "0" ; } st = new StringTokenizer ( line ) ; } return st . nextToken ( ) ; }   int nextInt ( ) throws IOException { return Integer . parseInt ( nextToken ( ) ) ; }   long nextLong ( ) throws IOException { return Long . parseLong ( nextToken ( ) ) ; }   double nextDouble ( ) throws IOException { return Double . parseDouble ( nextToken ( ) ) ; } }

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

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . * ;   public class Codeforces {   private static final Scanner sc = new Scanner ( System . in ) ; private static final BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; private static final long MOD = ( long ) ( 1e9 + 7 ) ;   public static int [ ] LPS ( String p ) { int [ ] lps = new int [ p . length ( ) ] ;   int i = 1 ; int j = 0 ; while ( i < p . length ( ) ) { if ( p . charAt ( i ) == p . charAt ( j ) ) { lps [ i ] = j + 1 ; i ++ ; j ++ ; } else { if ( j == 0 ) { lps [ i ] = 0 ; i ++ ; } else { j = lps [ j - 1 ] ; } } } return lps ; }   public static void KMP ( String text , String pattern ) { int [ ] lps = LPS ( pattern ) ; int i = 0 ; int j = 0 ; ArrayList < Integer > matches = new ArrayList < > ( ) ; while ( i < text . length ( ) ) { if ( text . charAt ( i ) == pattern . charAt ( j ) ) { i ++ ; j ++ ; } else { if ( j != 0 ) { j = lps [ j - 1 ] ; } else { i ++ ; } } if ( j == pattern . length ( ) ) { matches . add ( i - j ) ; j = lps [ j - 1 ] ; } } for ( int x : matches ) { System . out . println ( " Match ▁ at ▁ : ▁ " + x ) ; } }   private static class SegmentTree { private long [ ] st ; private int size ; private int n ; private long [ ] a ; SegmentTree ( long [ ] a , int n ) { this . size = 4 * n ; this . n = n ; this . a = a ; st = new long [ size ] ;

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 B66M2 {   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 = int ( input ( ) ) NEW_LINE b = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE maximum = 0 NEW_LINE for i in range ( a ) : ahead = 0 NEW_LINE behind = 0 NEW_LINE for j in range ( i , a - 1 ) : if NEW_LINE b [ j + 1 ] <= b [ j ] : ahead += 1 else : break NEW_LINE for k in range ( i , 0 , - 1 ) : if NEW_LINE b [ k - 1 ] <= b [ k ] : behind += 1 else : break NEW_LINE if ahead + behind > maximum : maximum = ahead + behindprint ( maximum + 1 ) NEW_LINE

n = int ( input ( ) ) NEW_LINE A = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE ans = 0 NEW_LINE for i in range ( len ( A ) ) : NEW_LINE

n = int ( input ( ) ) NEW_LINE arr = list ( map ( int , input ( ) . split ( ) ) )   water = [ 0 ] * n NEW_LINE

import sysimport NEW_LINE mathdef NEW_LINE fn ( n , a ) : m = 0 NEW_LINE k1 = 0 NEW_LINE k2 = 0 NEW_LINE for i in range ( n ) : c = 0 NEW_LINE k1 = i NEW_LINE for j in range ( i + 1 , n ) : if NEW_LINE a [ k1 ] >= a [ j ] : c = c + 1 NEW_LINE k1 = j else : break NEW_LINE k2 = i NEW_LINE for j1 in range ( i , - 1 , - 1 ) : if NEW_LINE a [ k2 ] >= a [ j1 ] : c = c + 1 NEW_LINE k2 = j1 else : break NEW_LINE if c > m : m = c NEW_LINE return mif NEW_LINE __name__ == ' _ _ main _ _ ' : input = sys . stdin . read ( ) NEW_LINE data = list ( map ( int , input . split ( ) ) ) NEW_LINE n = ( data [ 0 ] ) NEW_LINE h = data [ 1 : ] NEW_LINE print ( fn ( n , h ) ) NEW_LINE

import sysfrom NEW_LINE collections NEW_LINE import Counterdef NEW_LINE f1 ( n , l ) : m = 0 NEW_LINE k1 = 0 NEW_LINE k2 = 0 NEW_LINE for i in range ( n ) : c = 0 NEW_LINE k1 = i NEW_LINE for j in range ( i + 1 , n ) : if NEW_LINE l [ k1 ] >= l [ j ] : c = c + 1 NEW_LINE k1 = j else : break NEW_LINE k2 = i NEW_LINE for j1 in range ( i , - 1 , - 1 ) : if NEW_LINE l [ k2 ] >= l [ j1 ] : c = c + 1 NEW_LINE k2 = j1 else : break NEW_LINE if c > m : m = c NEW_LINE return m         if __name__ == ' _ _ main _ _ ' : input = sys . stdin . read ( ) NEW_LINE data = list ( map ( int , input . split ( ) ) ) NEW_LINE n = data [ 0 ] NEW_LINE l = data [ 1 : ] NEW_LINE print ( f1 ( n , l ) ) NEW_LINE


import java . io . * ; import java . util . * ; import java . util . ArrayList ;   public class CodeForce { static BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; static StringBuilder sb = new StringBuilder ( ) ;   static int next ( String [ ] sr , int ind ) { if ( sr [ ind ] . equals ( " S " ) || sr [ ind ] . equals ( " F " ) ) return 1000 ; return Integer . parseInt ( sr [ ind ] ) ; }   public static void main ( String [ ] args ) throws IOException { int n = Integer . parseInt ( br . readLine ( ) ) ; int [ ] arr = new int [ n ] ; int [ ] arr1 = new int [ n ] ; String [ ] sr = br . readLine ( ) . split ( " ▁ " ) ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = next ( sr , i ) ; } int k = arr [ 0 ] ; if ( k == 0 ) k = arr [ 1 ] ; sr = br . readLine ( ) . split ( " ▁ " ) ; int j = 0 ; for ( int i = 0 ; i < n ; i ++ ) { arr1 [ i ] = next ( sr , i ) ; if ( arr1 [ i ] == k ) j = i ; } int i = 0 ; while ( i < n ) { j = j % n ; if ( arr [ i ] == 0 ) i ++ ; if ( arr1 [ j ] == 0 ) { j ++ ; j = j % n ; } if ( i < n ) { if ( arr [ i ] != arr1 [ j ] ) { System . out . println ( " NO " ) ; return ; } } i ++ ; j ++ ; } System . out . println ( " YES " ) ; } }

import java . util . Scanner ; ; public class Main {

n = int ( input ( ) ) l1 = list ( map ( int , input ( ) . split ( ) ) ) l2 = list ( map ( int , input ( ) . split ( ) ) ) for k in range ( n ) : if l1 [ k ] == 0 : l1 = l1 [ : k ] + l1 [ k + 1 : ] breakfor k in range ( n ) : if l2 [ k ] == 0 : l2 = l2 [ : k ] + l2 [ k + 1 : ] break i = 0j = 0 ans = Truefor k in range ( n - 1 ) : if l1 [ k ] == 1 : i = k if l2 [ k ] == 1 : j = k for k in range ( n - 1 ) : if l1 [ ( i + k ) % ( n - 1 ) ] != l2 [ ( j + k ) % ( n - 1 ) ] : ans = False break if ans : print ( " YES " ) else : print ( " NO " ) NEW_LINE

def run ( ) : n = int ( input ( ) ) a = [ int ( i ) for i in input ( ) . split ( ) ] b = [ int ( i ) for i in input ( ) . split ( ) ]   i = a . index ( 1 ) j = b . index ( 1 ) ok = True cont = 0 while cont < n : if ( a [ i ] != b [ j ] ) : ok = False break i = ( i + 1 ) % n j = ( j + 1 ) % n if ( a [ i ] == 0 ) : i = ( i + 1 ) % n if ( b [ j ] == 0 ) : j = ( j + 1 ) % n   cont += 1 print ( ' YES ' if ok else ' NO ' )       if __name__ == " _ _ main _ _ " : run ( ) NEW_LINE

from sys import stdina = int ( stdin . readline ( ) ) b = input ( ) . replace ( ' ▁ ' , ' ' ) . replace ( '0' , ' ' ) c = input ( ) . replace ( ' ▁ ' , ' ' ) . replace ( '0' , ' ' ) if b in 2 * c : print ( " YES " ) else : print ( " NO " ) NEW_LINE

n = int ( input ( ) ) s1 = input ( ) . split ( ) s2 = input ( ) . split ( )   st1 = 0 st2 = 0 for i in range ( n ) : if s1 [ i ] == '1' : st1 = i if s2 [ i ] == '1' : st2 = i   i = ( st1 + 1 ) % nj = ( st2 + 1 ) % nf = Truesteps = 0 while steps < n : if s1 [ i ] == '0' : i = ( i + 1 ) % n if s2 [ j ] == '0' : j = ( j + 1 ) % n if s1 [ i ] != s2 [ j ] : f = False break i = ( i + 1 ) % n j = ( j + 1 ) % n steps += 1   if f : print ( ' YES ' ) else : print ( ' NO ' ) NEW_LINE


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

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . ArrayDeque ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . Random ; import java . util . StringTokenizer ;   public class Solution { public static void main ( String [ ] args ) throws IOException { FastScanner fs = new FastScanner ( ) ; PrintWriter out = new PrintWriter ( System . out ) ; int tt = 1 ; while ( tt -- > 0 ) { Point p1 = new Point ( fs . nextInt ( ) , fs . nextInt ( ) ) ; int r1 = fs . nextInt ( ) , R1 = fs . nextInt ( ) ; Point p2 = new Point ( fs . nextInt ( ) , fs . nextInt ( ) ) ; int r2 = fs . nextInt ( ) , R2 = fs . nextInt ( ) ; int ans = 0 ; ans += intersection ( p1 , r1 , p2 , r2 , R2 ) ; ans += intersection ( p1 , R1 , p2 , r2 , R2 ) ; ans += intersection ( p2 , r2 , p1 , r1 , R1 ) ; ans += intersection ( p2 , R2 , p1 , r1 , R1 ) ; out . println ( ans ) ; } out . close ( ) ; } static int intersection ( Point p1 , int r , Point p2 , int r2 , int R2 ) { if ( ( r + R2 <= p1 . dist ( p2 ) ) || ( r - R2 >= p1 . dist ( p2 ) ) || ( r2 - r >= p1 . dist ( p2 ) ) ) return 1 ; return 0 ; } static class Point { int x , y ; Point ( int x , int y ) { this . x = x ; this . y = y ; } double dist ( Point p ) { long dx = x - p . x , dy = y - p . y ; return Math . sqrt ( dx * dx + dy * dy ) ; } } static final Random random = new Random ( ) ; static void ruffleSort ( int [ ] a ) { int n = a . length ;

( ( x , y , r , R ) , ( u , v , w , W ) ) = [ map ( int , input ( ) . split ( ) ) for _ in range ( 2 ) ] d = ( x - u ) ** 2 + ( y - v ) ** 2   def t ( a , b , c ) : if c <= a and ( a - c ) ** 2 >= d : return 1 if c >= b and ( c - b ) ** 2 >= d : return 1 if ( b + c ) ** 2 <= d : return 1 return 0 print ( t ( r , R , w ) + t ( r , R , W ) + t ( w , W , r ) + t ( w , W , R ) ) NEW_LINE

import mathdef intersect ( r1 , R1 , r ) : global d if d + r <= r1 : return 1 elif r + R1 <= d : return 1 elif d + R1 <= r : return 1 return 0   x1 , y1 , r1 , R1 = map ( int , input ( ) . split ( ) ) x2 , y2 , r2 , R2 = map ( int , input ( ) . split ( ) ) d = math . sqrt ( ( x1 - x2 ) ** 2 + ( y1 - y2 ) ** 2 ) print ( intersect ( r1 , R1 , r2 ) + intersect ( r1 , R1 , R2 ) + intersect ( r2 , R2 , r1 ) + intersect ( r2 , R2 , R1 ) )             NEW_LINE

def okay ( xc , yc , rc , xr , yr , rr , Rr ) : d = ( ( xc - xr ) ** 2 + ( yc - yr ) ** 2 ) ** 0.5 if d + rc <= rr : return True if d >= rc + Rr : return True if d + Rr <= rc : return True return False   x1 , y1 , r1 , R1 = map ( float , input ( ) . split ( ) ) x2 , y2 , r2 , R2 = map ( float , input ( ) . split ( ) ) ans = 0 if okay ( x2 , y2 , r2 , x1 , y1 , r1 , R1 ) : ans += 1 if okay ( x2 , y2 , R2 , x1 , y1 , r1 , R1 ) : ans += 1 if okay ( x1 , y1 , r1 , x2 , y2 , r2 , R2 ) : ans += 1 if okay ( x1 , y1 , R1 , x2 , y2 , r2 , R2 ) : ans += 1 print ( ans ) 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 ) { long l1 = s . nextLong ( ) ; long r1 = s . nextLong ( ) ; long l2 = s . nextLong ( ) ; long r2 = s . nextLong ( ) ; long min = Math . min ( l1 , r1 ) ; long max = Math . max ( l2 , r2 ) ; if ( min == max ) { System . out . println ( Math . max ( l1 , r1 ) + " ▁ " + Math . max ( l2 , r2 ) ) ;   } else { System . out . println ( min + " ▁ " + max ) ; } } } }

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 . 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 . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . Collections ; import java . util . HashSet ; import java . util . StringTokenizer ;   public class A { public static void main ( String [ ] args ) { FastScanner fs = new FastScanner ( ) ; int t = fs . nextInt ( ) ; while ( t -- > 0 ) { int a = fs . nextInt ( ) ; int b = fs . nextInt ( ) ; int c = fs . nextInt ( ) ; int d = fs . nextInt ( ) ; int x = 0 ; int y = 0 ; x = a ; y = c ; if ( x == y ) x = b ; System . out . println ( x + " ▁ " + y ) ; } } static class FastScanner { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( " " ) ; String next ( ) { while ( ! st . hasMoreTokens ( ) ) try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return st . nextToken ( ) ; } int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } int [ ] readArray ( int n ) { int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = nextInt ( ) ; return a ; } long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } } }

cases = int ( input ( ) ) for __ in range ( cases ) : l1 , r1 , l2 , r2 = list ( map ( int , input ( ) . split ( ) ) ) if ( l1 != l2 ) : print ( l1 , l2 ) else : print ( l1 , r2 ) NEW_LINE

def string_to_list ( s , char ) : collector = " " output_list = [ ] for i in range ( len ( s ) ) : if s [ i ] != char : collector += s [ i ] if i == len ( s ) - 1 : output_list . append ( int ( collector ) ) else : output_list . append ( int ( collector ) ) collector = " " return output_list     NEW_LINE

n_queries = int ( input ( ) ) for _ in range ( n_queries ) : l1 , r1 , l2 , r2 = map ( int , input ( ) . strip ( ) . split ( ' ▁ ' ) ) if l1 != l2 : print ( f ' { l1 } ▁ { l2 } ' ) elif l1 != r1 : print ( f ' { r1 } ▁ { l2 } ' ) else : print ( f ' { l1 } ▁ { r2 } ' )       NEW_LINE

Q = int ( input ( ) )   for _ in range ( Q ) :   l1 , r1 , l2 , r2 = list ( map ( int , input ( ) . split ( ) ) )   if l1 != l2 : print ( l1 , l2 ) else : print ( l1 , r2 ) NEW_LINE

q = int ( input ( ) ) for i in range ( q ) : l1 , r1 , l2 , r2 = list ( input ( ) . strip ( ) . split ( ) ) if l1 != l2 : print ( l1 , l2 ) else : print ( l1 , r2 ) NEW_LINE


import java . util . * ;   public class GameWithString {   public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String inputString = scan . nextLine ( ) ; StringBuffer gameString = new StringBuffer ( ) ; int playerTurn = 0 ; gameString . append ( inputString ) ; for ( int i = 1 ; i < gameString . length ( ) ; i ++ ) { if ( gameString . charAt ( i ) == gameString . charAt ( i - 1 ) ) { gameString . deleteCharAt ( i - 1 ) ; gameString . deleteCharAt ( i - 1 ) ; playerTurn ++ ; i = Math . max ( i - 2 , 0 ) ; } } if ( playerTurn % 2 == 0 ) { System . out . println ( " No " ) ; } else { System . out . println ( " Yes " ) ; }

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Stack ; import java . util . StringTokenizer ;   public class C { static class FastScanner { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( " " ) ; String next ( ) { while ( ! st . hasMoreTokens ( ) ) try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return st . nextToken ( ) ; } int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } int [ ] readArray ( int n ) { int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = nextInt ( ) ; return a ; } long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } } public static void main ( String [ ] args ) { FastScanner fs = new FastScanner ( ) ; String s = fs . next ( ) ; int dels = 0 ; Stack < Character > st = new Stack < > ( ) ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { if ( st . size ( ) > 0 ) { if ( s . charAt ( i ) == st . peek ( ) ) { st . pop ( ) ; dels ++ ; } else { st . push ( s . charAt ( i ) ) ; } } else { st . push ( s . charAt ( i ) ) ; } } if ( dels % 2 == 0 ) { System . out . println ( " NO " ) ; } else { System . out . println ( " YES " ) ; } } }

import java . io . * ;   import java . util . * ; public class Solution {

n = input ( ) lst = [ ] cnt = 0 for i in n : if len ( lst ) == 0 : lst . append ( i ) elif i == lst [ - 1 ] : lst . pop ( ) cnt += 1 else : lst . append ( i ) if cnt % 2 == 0 : print ( ' No ' ) else : print ( ' Yes ' ) NEW_LINE

s = input ( ) st = [ '0' ] c = 0 for i in s : NEW_LINE

s = input ( ) res = [ ' ' ] cnt = 0 for i in s : if i == res [ - 1 ] : res . pop ( ) cnt += 1 else : res . append ( i ) print ( " Yes " if cnt % 2 == 1 else " No " ) NEW_LINE

s = list ( input ( ) ) i = 0 count = 0 while i < len ( s ) - 1 : if s [ i ] == s [ i + 1 ] : s . pop ( i ) s . pop ( i ) count += 1 if i > 0 : i -= 1 else : i += 1 print ( " YES " if count % 2 == 1 else " NO " ) NEW_LINE


import java . util . Scanner ;   public class TextDocumentAnalysis {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; char [ ] c = sc . next ( ) . toCharArray ( ) ; int wip = 0 , max = 0 , len ; int j ; for ( int i = 0 ; i < n ; ) { if ( c [ i ] == ' ( ' ) { j = i + 1 ; while ( c [ j ] != ' ) ' ) { len = 0 ; while ( j < n && c [ j ] != ' _ ' && c [ j ] != ' ) ' ) { len ++ ; j ++ ; } if ( len > 0 ) wip ++ ; if ( c [ j ] == ' _ ' ) j ++ ; } j ++ ; i = j ; } else if ( c [ i ] != ' _ ' ) { j = i + 1 ; while ( j < n && c [ j ] != ' _ ' && c [ j ] != ' ( ' && c [ j ] != ' ) ' ) { j ++ ; } max = Math . max ( max , j - i ) ; i = j ; } else i ++ ; } System . out . println ( max + " ▁ " + wip ) ; sc . close ( ) ; } }

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . * ;   public class Main { public static void main ( String [ ] args ) { FastScanner input = new FastScanner ( ) ; int n = input . nextInt ( ) ; String s = input . next ( ) ; int max = Integer . MIN_VALUE ; int parenMax = 0 ; int count = 0 ; int parencount = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( s . charAt ( i ) == ' ( ' ) { max = Math . max ( max , count ) ; count = 0 ; parencount = 0 ; for ( i = i + 1 ; ; i ++ ) { if ( s . charAt ( i ) == ' ) ' ) { if ( parencount > 0 ) parenMax ++ ; parencount = 0 ; break ; } else if ( s . charAt ( i ) == ' _ ' ) { if ( parencount > 0 ) parenMax ++ ; parencount = 0 ; } else parencount ++ ; } } else if ( s . charAt ( i ) == ' _ ' ) { max = Math . max ( max , count ) ; count = 0 ; } else { count ++ ; } } max = Math . max ( max , count ) ; System . out . println ( max + " ▁ " + parenMax ) ; }   static class FastScanner {   BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( " " ) ;   String next ( ) { while ( ! st . hasMoreTokens ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; }   int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; }   long nextLong ( ) {   return Long . parseLong ( next ( ) ) ; }   double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; }   String nextLine ( ) throws IOException { return br . readLine ( ) ; } }   }

import java . util . Scanner ;   public class TextDocAnalysis { public static void main ( String [ ] args ) {   Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) , i , m = 0 , l = 0 , w = 0 , wl = 0 ; String s = in . next ( ) ; boolean p = false ;   in . close ( ) ; for ( i = 0 ; i < n ; i ++ ) { char c = s . charAt ( i ) ;   if ( c == ' ( ' ) { p = true ; m = Math . max ( m , l ) ; l = 0 ; wl = 0 ; } else if ( c == ' ) ' ) { p = false ; m = Math . max ( m , l ) ; l = 0 ; wl = 0 ; } else if ( c == ' _ ' ) { m = Math . max ( m , l ) ; l = 0 ; wl = 0 ; } else if ( c != ' _ ' && ! p ) { l ++ ; } else if ( c != ' _ ' && p && wl == 0 ) { w ++ ; wl ++ ; } } System . out . println ( Math . max ( m , l ) + " ▁ " + w ) ; } }

import java . util . Scanner ; public class _723B { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; char [ ] s = sc . next ( ) . toCharArray ( ) ; boolean in = false ; int len = 0 , maxLen = 0 , words = 0 ; for ( int i = 0 ; i < s . length ; i ++ ) { if ( ' a ' <= s [ i ] && s [ i ] <= ' z ' || ' A ' <= s [ i ] && s [ i ] <= ' Z ' ) len ++ ; else len = 0 ; if ( s [ i ] == ' ( ' ) in = true ; else if ( s [ i ] == ' ) ' ) in = false ; if ( in ) { if ( len == 1 ) words ++ ; } else maxLen = Math . max ( len , maxLen ) ; } System . out . println ( maxLen + " ▁ " + words ) ; } }

n = int ( input ( ) ) st = input ( ) n += 1 st += ' _ ' v_sk = [ ] bz_sk = [ ] dd = 0 dd1 = 0 sw = Falsect = 0 long = [ ] for e in range ( n ) : if st [ e ] == ' ( ' : bz_sk . append ( st [ dd1 : e ] ) dd = e + 1 elif st [ e ] == ' ) ' : v_sk . append ( st [ dd : e ] ) dd1 = e + 1 bz_sk . append ( st [ dd1 : ] ) for e in v_sk : rem = - 1 e += ' _ ' for qq in range ( len ( e ) ) : if e [ qq ] == ' _ ' : if rem == - 1 : continue else : ct += 1 rem = - 1 else : rem = qqfor e in bz_sk : z = e . split ( ' _ ' ) for k in z : kk = 0 for ee in k : if ee != ' _ ' : kk += 1 long . append ( kk ) print ( max ( long ) , ct ) NEW_LINE

n , s = int ( input ( ) ) , input ( ) max_len , in_par = 0 , 0 while s . find ( ' ( ' ) != - 1 : i , j = s . find ( ' ( ' ) , s . find ( ' ) ' ) in_par += len ( [ t for t in s [ i + 1 : j ] . split ( ' _ ' ) if t ] ) s = s [ : i ] + " _ " + s [ j + 1 : ] max_len = max ( [ len ( t ) for t in s . split ( ' _ ' ) ] ) print ( max_len , in_par ) NEW_LINE

n = int ( input ( ) ) s = input ( ) . replace ( ' ▁ ' , ' ' ) f = Falsea = b = 0 for chr in s . replace ( ' ( ' , ' ) ' ) . split ( ' ) ' ) : for i in chr . split ( ' _ ' ) : if f : b += len ( i ) != 0 else : a = max ( a , len ( i ) ) f = not fprint ( a , b ) NEW_LINE

n = int ( input ( ) ) s = str ( input ( ) ) outside , inside = ' ' , ' ' p = 0 while p < n : if s [ p ] == ' ( ' : pd = p + 1 while pd < n : if s [ pd ] == ' ) ' : pd += 1 break inside += s [ pd ] pd += 1 p = pd inside += ' _ ' else : outside += s [ p ] p += 1 if p < n : if s [ p ] == ' ( ' or s [ p ] == ' ) ' : outside += ' _ ' outside = outside . split ( ' _ ' ) inside = inside . split ( ' _ ' ) val = 0 for j in range ( len ( outside ) ) : val = max ( val , len ( outside [ j ] ) ) length = 0 for j in range ( len ( inside ) ) : if len ( inside [ j ] ) > 0 : length += 1 print ( val , length ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . Arrays ; import java . util . Random ; import java . util . StringTokenizer ;   public class Solution { static final int N = ( int ) 2e6 + 10 ; public static void main ( String [ ] args ) throws IOException { FastScanner fs = new FastScanner ( ) ; PrintWriter out = new PrintWriter ( System . out ) ; int tt = 1 ; while ( tt -- > 0 ) { int n = fs . nextInt ( ) ; int [ ] a = fs . readArray ( n ) ; ruffleSort ( a ) ; int [ ] pos = new int [ N ] ; Arrays . fill ( pos , - 1 ) ; boolean [ ] done = new boolean [ N ] ; for ( int i = 0 ; i < n ; i ++ ) { pos [ a [ i ] ] = i ; } for ( int i = 1 ; i < N ; i ++ ) { if ( pos [ i ] == - 1 ) pos [ i ] = pos [ i - 1 ] ; } int ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( ! done [ a [ i ] ] ) { done [ a [ i ] ] = true ; for ( int j = 2 * a [ i ] ; j < N ; j += a [ i ] ) { int ind = pos [ j - 1 ] ; if ( ind != i ) ans = Math . max ( ans , a [ ind ] % a [ i ] ) ; if ( ind == n - 1 ) break ; } } } out . println ( ans ) ; } out . close ( ) ; } static final Random random = new Random ( ) ; static < T > void shuffle ( T [ ] arr ) { int n = arr . length ; for ( int i = 0 ; i < n ; i ++ ) { int k = random . nextInt ( n ) ; T temp = arr [ k ] ; arr [ k ] = arr [ i ] ; arr [ i ] = temp ; } } static void ruffleSort ( int [ ] a ) { int n = a . length ;

public class p484B { public static void main ( String [ ] args ) { java . util . Scanner sc = new java . util . Scanner ( System . in ) ; int n = sc . nextInt ( ) , m = 0 , l = 2000001 , a [ ] = new int [ l ] , pre [ ] = new int [ l ] ; for ( int i = 0 ; i < n ; i ++ ) a [ sc . nextInt ( ) ] ++ ; for ( int i = 1 ; i < l ; i ++ ) if ( a [ i - 1 ] > 0 ) pre [ i ] = i - 1 ; else pre [ i ] = pre [ i - 1 ] ; for ( int i = 1 ; i < l ; i ++ ) if ( a [ i ] > 0 ) for ( int j = i * 2 ; j < l ; j += i ) m = Math . max ( m , pre [ j ] % i ) ; System . out . println ( m ) ; } }

n = int ( input ( ) ) a = list ( set ( map ( int , input ( ) . split ( ) ) ) ) mx = max ( a )   b = [ 0 ] * ( 2 * mx ) for e in a : b [ e ] = efor i in range ( 1 , len ( b ) ) : if b [ i ] == 0 : b [ i ] = b [ i - 1 ]   best = 0 for e in a : for m in range ( 2 * e , 2 * mx , e ) : if b [ m - 1 ] >= e : best = max ( best , b [ m - 1 ] % e ) print ( best ) NEW_LINE

n = int ( input ( ) ) l = list ( map ( int , input ( ) . split ( ' ▁ ' ) ) ) l = list ( set ( l ) )   lb = [ - 1 ] * 3000001 NEW_LINE


import java . io . BufferedReader ;   import java . io . IOException ; import java . io . InputStreamReader ; import java . math . BigInteger ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . HashMap ; import java . util . List ; import java . util . Map ; import java . util . Scanner ;   public class test {

import java . util . Scanner ;   public class CashierBreaks { public static void main ( String [ ] args ) {   Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) , m = in . nextInt ( ) , a = in . nextInt ( ) , b = 0 , x = 0 ; while ( n -- > 0 ) { int t = in . nextInt ( ) , l = in . nextInt ( ) ; b += ( t - x ) / a ; x = t + l ; } System . out . println ( b + ( m - x ) / a ) ; in . close ( ) ; } }

import java . util . * ; public class Cashier {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int work = sc . nextInt ( ) ; int breakLength = sc . nextInt ( ) ; int [ ] [ ] customers = new int [ n ] [ ] ; for ( int i = 0 ; i < n ; i ++ ) customers [ i ] = new int [ ] { sc . nextInt ( ) , sc . nextInt ( ) } ; sc . close ( ) ; if ( n == 0 ) { System . out . println ( work / breakLength ) ; sc . close ( ) ; return ; } int num = 0 ; int time = 0 ; for ( int i = 0 ; i < n ; i ++ ) if ( customers [ i ] [ 0 ] - time >= breakLength ) { time += breakLength ; num ++ ; i -- ; } else time = customers [ i ] [ 0 ] + customers [ i ] [ 1 ] ; num += ( work - time ) / breakLength ; System . out . println ( num ) ; } }

import java . util . Scanner ;   public class _0729Cashier {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int L = sc . nextInt ( ) ; int a = sc . nextInt ( ) ; int currIndex = 0 ; int CountBrakes = 0 ; for ( int i = 0 ; i < n ; i ++ ) { int t = sc . nextInt ( ) ; int l = sc . nextInt ( ) ; CountBrakes += ( t - currIndex ) / a ; currIndex = t + l ; } CountBrakes += ( L - currIndex ) / a ; System . out . println ( CountBrakes ) ; }   }

n , L , a = map ( int , input ( ) . split ( ) ) T = [ ( 0 , 0 ) ] for i in range ( n ) : t , l = map ( int , input ( ) . split ( ) ) l += t T . append ( ( t , l ) )   count = 0 for i in range ( 1 , n + 1 ) : if ( T [ i ] [ 0 ] - T [ i - 1 ] [ 1 ] >= a ) : count += ( T [ i ] [ 0 ] - T [ i - 1 ] [ 1 ] ) // aif ( L - T [ n ] [ 1 ] >= a ) : count += ( L - T [ n ] [ 1 ] ) // aprint ( count )           NEW_LINE

n , l , a = map ( int , input ( ) . split ( ) ) current = 0 ans = 0 for i in range ( n ) : x , y = map ( int , input ( ) . split ( ) ) ans += ( x - current ) // a current = x + yans += ( l - current ) // aprint ( ans ) NEW_LINE

import mathn , L , a = map ( int , input ( ) . split ( ) ) br = 0 c = 0 for i in range ( n ) : t , l = map ( int , input ( ) . split ( ) ) if i == 0 : if ( t - a ) >= 0 : br = br + ( math . floor ( t / a ) ) L = L - ( t + l ) c = l + t else : L = L - ( t + l ) c = l + t else : if ( t - c ) >= a : br = br + ( math . floor ( ( t - c ) / a ) ) L = L - ( t - c + l ) elif t == c : L = L - ( l ) else : L = L - ( l + t - c ) c = l + t   if ( L >= a ) : print ( br + math . floor ( ( L / a ) ) ) else : print ( br ) NEW_LINE

n , L , a = map ( int , input ( ) . split ( ) ) actual = 0 breaks = 0   for i in range ( n ) : t , l = map ( int , input ( ) . split ( ) ) breaks += ( t - actual ) // a actual = t + l   print ( breaks + ( L - actual ) // a ) NEW_LINE

n , L , a = map ( int , input ( ) . split ( ) ) prev , ans = 0 , 0 for _ in range ( n ) : t , l = map ( int , input ( ) . split ( ) ) ans += ( t - prev ) // a prev = t + lans += ( L - prev ) // aprint ( ans ) NEW_LINE


import java . util . Scanner ;   public class PlayingWithPaper {   public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; long a = scan . nextLong ( ) ; long b = scan . nextLong ( ) ; if ( b == 1 ) System . out . println ( a ) ; else if ( a % b == 0 ) System . out . println ( a / b ) ; else { long count = 0 ; while ( a > 0 && b > 0 ) { if ( a > b ) { count += a / b ; a = a % b ; } else { count += b / a ; b = b % a ; } } System . out . println ( count ) ; } }   }

import java . util . * ;   public class questionA2OJ { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long a = sc . nextLong ( ) ; long b = sc . nextLong ( ) ; long s = 0 ; while ( a > 0 && b > 0 ) { if ( a > b ) { s += a / b ; a = a % b ; } else { s += b / a ; b = b % a ; } } System . out . println ( s ) ; } }

contador = 0   def dobrar_papel ( a , b ) : global contador if ( a <= 0 or b <= 0 ) : return None if ( a == b ) :   contador = contador + 1 ; return None elif ( b > a ) : max_fator = binario ( b , a ) contador = contador + max_fator dobrar_papel ( a , b - max_fator * a ) else : max_fator = binario ( a , b ) contador += max_fator dobrar_papel ( a - max_fator * b , b )   def binario ( grande , pequeno ) : aux = - 1 limite_superior = grande limite_inferior = 1 while ( limite_inferior <= limite_superior ) : media = ( limite_superior + limite_inferior ) // 2 if ( media == aux ) : break if ( media * pequeno >= grande ) : limite_superior = media - 1 elif ( media * pequeno < grande ) : limite_inferior = media aux = media return media   def main ( ) : entrada = input ( ) entrada = entrada . split ( " ▁ " ) a = int ( entrada [ 0 ] ) b = int ( entrada [ 1 ] ) dobrar_papel ( a , b ) print ( contador ) main ( ) NEW_LINE

def main ( ) : nums = input ( ) . split ( ' ▁ ' ) a , b = int ( nums [ 0 ] ) , int ( nums [ 1 ] ) cort = True cont = 0   while cort : if a == 0 or b == 0 : cort = False   elif a == 1 : cont += b * 1 cort = False elif b == 1 : cont += a * 1 cort = False elif a == b : cont += 1 cort = False elif a > b : cont += ( a // b ) a -= ( b * ( a // b ) ) else : cont += ( b // a ) b -= ( a * ( b // a ) )   print ( cont ) return     main ( ) NEW_LINE

finished = Falselado = list ( map ( int , input ( ) . split ( ) ) ) navios = 0 base = lado [ 0 ] altura = lado [ 1 ] while altura != 0 : navios += ( base // altura ) ( base , altura ) = ( altura , base % altura ) print ( navios ) NEW_LINE

a , b = map ( int , input ( ) . split ( ) )   NEW_LINE


import java . util . * ; public class Problem { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int d = sc . nextInt ( ) ; String [ ] from = new String [ n ] ; String [ ] to = new String [ n ] ; int [ ] time = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { from [ i ] = sc . next ( ) ; to [ i ] = sc . next ( ) ; time [ i ] = sc . nextInt ( ) ; } HashSet < String > ans = new HashSet < String > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = i + 1 ; j < n ; j ++ ) { if ( from [ i ] . equals ( to [ j ] ) && to [ i ] . equals ( from [ j ] ) && time [ j ] - time [ i ] <= d && time [ j ] - time [ i ] > 0 ) { ans . add ( fixStr ( from [ i ] , to [ i ] ) ) ; } } } System . out . println ( ans . size ( ) ) ; for ( String s : ans ) { System . out . println ( s ) ; } } private static String fixStr ( String a , String b ) { if ( a . compareTo ( b ) > 0 ) { return b + " ▁ " + a ; } else { return a + " ▁ " + b ; } } }

import java . util . * ;   public class Main { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int n = scanner . nextInt ( ) ; int d = scanner . nextInt ( ) ; Map < String , List < Integer > > messagesMap = new HashMap < > ( ) ; Map < String , String > invertedParticipantsMap = new HashMap < > ( ) ; Set < String > friends = new HashSet < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { String a = scanner . next ( ) ; String b = scanner . next ( ) ; int t = scanner . nextInt ( ) ; messagesMap . putIfAbsent ( a + " ▁ " + b , new ArrayList < > ( ) ) ; messagesMap . get ( a + " ▁ " + b ) . add ( t ) ; invertedParticipantsMap . put ( b + " ▁ " + a , a + " ▁ " + b ) ; if ( i > 0 && messagesMap . containsKey ( invertedParticipantsMap . get ( a + " ▁ " + b ) ) ) { for ( Integer previousT : messagesMap . get ( invertedParticipantsMap . get ( a + " ▁ " + b ) ) ) { if ( t - previousT <= d && t - previousT > 0 ) { if ( ! friends . contains ( a + " ▁ " + b ) && ! friends . contains ( b + " ▁ " + a ) ) { friends . add ( a + " ▁ " + b ) ; } break ; } } } } System . out . println ( friends . size ( ) ) ; friends . forEach ( f -> System . out . println ( f ) ) ; } }

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

l = input ( ) . split ( ) n = int ( l [ 0 ] ) d = int ( l [ 1 ] ) lfi = [ ] lofpairs = [ ] for you in range ( n ) : s = input ( ) . split ( ) for i in lfi : if ( s [ 0 ] == i [ 1 ] and s [ 1 ] == i [ 0 ] ) : if ( int ( s [ 2 ] ) - int ( i [ 2 ] ) <= d and int ( s [ 2 ] ) - int ( i [ 2 ] ) != 0 ) : if ( ( i [ 0 ] , i [ 1 ] ) not in lofpairs and ( i [ 1 ] , i [ 0 ] ) not in lofpairs ) : lofpairs . append ( ( i [ 0 ] , i [ 1 ] ) ) lfi . append ( s ) print ( len ( lofpairs ) ) for i in lofpairs : print ( i [ 0 ] , i [ 1 ] ) NEW_LINE

import sysfrom collections import Countern , k = map ( int , input ( ) . split ( ) ) l = [ ] for i in range ( n ) : p , q , t = map ( str , sys . stdin . readline ( ) . split ( ) ) t = int ( t ) l . append ( [ [ p , q ] , t ] ) NEW_LINE

n , d = map ( int , input ( ) . split ( ) ) arr = [ ] for _ in range ( n ) : a , b , c = input ( ) . split ( ) curr = [ a , b , int ( c ) ] arr . append ( curr ) ans = [ ] for i in range ( n ) : for j in range ( i + 1 , n ) : if abs ( arr [ i ] [ 2 ] - arr [ j ] [ 2 ] ) <= d and abs ( arr [ i ] [ 2 ] - arr [ j ] [ 2 ] ) > 0 : if arr [ i ] [ 0 ] == arr [ j ] [ 1 ] and arr [ i ] [ 1 ] == arr [ j ] [ 0 ] : ans . append ( ( arr [ i ] [ 1 ] , arr [ i ] [ 0 ] ) ) elif abs ( arr [ i ] [ 2 ] - arr [ j ] [ 2 ] ) > d : breakif ans == [ ] : print ( 0 ) else : distinct_ans = [ ] for i in ans : i = list ( i ) x = i . sort ( ) distinct_ans . append ( i ) stack = [ ] for i in distinct_ans : if i not in stack : stack . append ( i ) print ( len ( stack ) ) for i in stack : for j in i : print ( j , end = ' ▁ ' ) print ( ) NEW_LINE


import java . util . * ;   public class CodeForces { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int t = scan . nextInt ( ) ;   while ( t -- > 0 ) { int n = scan . nextInt ( ) ; int sum = 0 ;   for ( int i = 0 ; i < n ; i ++ ) sum += ( scan . nextInt ( ) % 2 ) ;   if ( sum == 0 || sum == n ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ;   } } }

for i in range ( int ( input ( ) ) ) : n = int ( input ( ) ) cnto = sum ( list ( map ( lambda x : int ( x ) % 2 , input ( ) . split ( ) ) ) ) print ( ' YES ' if cnto == 0 or cnto == n else ' NO ' ) NEW_LINE

cases = int ( input ( ) ) while cases : cases -= 1 num = int ( input ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) odds = sum ( 1 for i in arr if i % 2 != 0 )   if odds == 0 or odds == num : print ( " YES " ) else : print ( " NO " ) NEW_LINE

for _ in range ( int ( input ( ) ) ) : n = int ( input ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) ans = 0 sum = 0 for i in l : if i % 2 == 0 : ans += 1 elif i % 2 != 0 : sum += 1 if ans == n or sum == n : print ( " YES " ) else : print ( " NO " ) NEW_LINE

import sysfrom os import pathif ( path . exists ( ' input . txt ' ) and path . exists ( ' output . txt ' ) ) : sys . stdout = open ( ' output . txt ' , ' w ' ) sys . stdin = open ( ' input . txt ' , ' r ' )     def main ( ) : T = int ( input ( ) ) for ii in range ( 0 , T ) : N = int ( input ( ) ) figs = list ( map ( int , input ( ) . split ( ) ) ) for fig in figs : if fig == 0 : fig += 2 break mn = min ( figs ) ok = True for fig in figs : if ( fig - mn ) % 2 == 1 : ok = False break print ( " YES " if ok else " NO " )     main ( ) NEW_LINE

for _ in range ( int ( input ( ) ) ) : n = int ( input ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) p = 0 for i in l : p += i % 2 if p == 0 or p == n : print ( " YES " ) else : print ( " NO " ) NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ;   public class NumberGuessing { public static void main ( String [ ] args ) throws IOException { BufferedReader reader = new BufferedReader ( new InputStreamReader ( System . in ) ) ;   int n = Integer . parseInt ( reader . readLine ( ) ) ;   Integer l = null , u = null ;   for ( int i = 0 ; i < n ; i ++ ) { String [ ] line = reader . readLine ( ) . split ( " ▁ " ) ; int x = Integer . parseInt ( line [ 1 ] ) ;   switch ( line [ 0 ] ) { case " > " : if ( line [ 2 ] . equals ( " Y " ) ) { if ( l == null || l <= x ) l = x + 1 ; } else if ( u == null || u > x ) u = x ; break ; case " < " : if ( line [ 2 ] . equals ( " Y " ) ) { if ( u == null || u >= x ) u = x - 1 ; } else if ( l == null || l < x ) l = x ; break ; case " > = " : if ( line [ 2 ] . equals ( " Y " ) ) { if ( l == null || l < x ) l = x ; } else if ( u == null || u >= x ) u = x - 1 ; break ; default : if ( line [ 2 ] . equals ( " Y " ) ) { if ( u == null || u > x ) u = x ; } else if ( l == null || l <= x ) l = x + 1 ; } }   if ( l == null ) System . out . println ( u ) ; else if ( u == null || l <= u ) System . out . println ( l ) ; else System . out . println ( " Impossible " ) ; } }

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

import java . util . Scanner ;   public class GuessANumber { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ;   long min = - 2000000000L , max = 2000000000L ;   while ( t -- > 0 ) { String sign = sc . next ( ) ; long n = sc . nextLong ( ) ; char ans = sc . next ( ) . charAt ( 0 ) ;   switch ( sign ) { case " > " : if ( ans == ' Y ' ) { min = Math . max ( min , n + 1 ) ; } else { max = Math . min ( max , n ) ; } break ;   case " < " : if ( ans == ' Y ' ) { max = Math . min ( max , n - 1 ) ; } else { min = Math . max ( min , n ) ; } break ;   case " > = " : if ( ans == ' Y ' ) { min = Math . max ( min , n ) ; } else { max = Math . min ( max , n - 1 ) ; } break ;   case " < = " : if ( ans == ' Y ' ) { max = Math . min ( max , n ) ; } else { min = Math . max ( min , n + 1 ) ; } break ; } } if ( min > max ) { System . out . println ( " Impossible " ) ; } else { System . out . println ( min ) ; } } }

left = - 2000000000 right = 2000000000   for _ in range ( int ( input ( ) ) ) : temp = input ( ) . split ( ) sign = temp [ 0 ] n = int ( temp [ 1 ] ) tf = temp [ 2 ] if tf == ' Y ' : if sign == ' > ' and left <= n : left = n + 1 elif sign == ' > = ' and left < n : left = n elif sign == ' < ' and right >= n : right = n - 1 elif sign == ' < = ' and right > n : right = n elif tf == ' N ' : if sign == ' > ' and right > n : right = n elif sign == ' > = ' and right >= n : right = n - 1 elif sign == ' < ' and left < n : left = n elif sign == ' < = ' and left <= n : left = n + 1 if left <= right : print ( left ) else : print ( ' Impossible ' ) NEW_LINE

n = int ( input ( ) ) flag = True l = - 2e9 r = 2e9 for i in range ( n ) : q = input ( ) ans = q [ - 1 ] if ( ans == ' Y ' ) : ans = True else : ans = False if ( q [ 1 ] == ' = ' ) : num = int ( q [ 3 : - 2 ] ) else : num = int ( q [ 2 : - 2 ] )   NEW_LINE

greater = - 2000000000 smaller = 2000000000 n = int ( input ( ) ) for _ in range ( n ) : a , b , c = input ( ) . split ( ) if a == " > = " : if c == " Y " : greater = max ( greater , int ( b ) ) else : smaller = min ( smaller , int ( b ) - 1 ) elif a == " < = " : if c == " Y " : smaller = min ( int ( b ) , smaller ) NEW_LINE


import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int k = sc . nextInt ( ) ; int count = 0 ; for ( int i = 1 ; i <= n ; i ++ ) { if ( k % i == 0 && k / i <= n ) count ++ ; } System . out . println ( count ) ; } }

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

import java . util . * ;   public class Example { static int [ ] dp ;   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ;

import java . util . Scanner ;    public class MutliTable { public static void main ( String [ ] args ) { Scanner S = new Scanner ( System . in ) ; int table = S . nextInt ( ) ; int find = S . nextInt ( ) ; int answer = 0 ; for ( int x = 1 ; x <= table ; x ++ ) { if ( find % x == 0 && find / x <= table ) answer ++ ; } System . out . print ( answer ) ; } }

n , x = map ( int , input ( ) . split ( ) ) count = 0 for i in range ( 1 , n + 1 ) : if x % i == 0 and x // i <= n and i <= n : count = count + 1 print ( count ) NEW_LINE

rowscolumns , result = [ int ( i ) for i in input ( ) . split ( ) ]   counter = 0   for col in range ( 1 , rowscolumns + 1 ) : if result % col == 0 and result / col <= rowscolumns : counter += 1                                     print ( counter ) NEW_LINE

a = list ( map ( int , input ( ) . split ( ) ) ) n = a [ 0 ] x = a [ 1 ] c = 0 for i in range ( 1 , n + 1 ) : if x % i == 0 and x / i <= n : c = c + 1 print ( c ) NEW_LINE


import java . awt . * ; import java . io . IOException ; import java . util . Comparator ; import java . util . HashSet ; import java . util . Scanner ;   public class Main {

import java . util . * ;   public class Testing { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int m = sc . nextInt ( ) ; int n = sc . nextInt ( ) ; int sum = m ; int iteration = 0 ; boolean flag = false ; while ( iteration <= 20 ) { if ( sum % n == 0 ) { System . out . println ( " Yes " ) ; flag = true ; break ; } iteration ++ ; sum *= 2 ; } if ( ! flag ) System . out . println ( " No " ) ; } }

a , m = map ( int , input ( ) . split ( ) ) i = 0 f = 0 while i < m : if a % m == 0 : print ( ' Yes ' ) f = 1 break a += a % m i += 1   if f == 0 : print ( ' No ' ) NEW_LINE

a , m = map ( int , input ( ) . split ( ) ) for i in range ( 21 ) : if a % m == 0 : print ( " Yes " ) exit ( ) a *= 2 print ( " No " ) NEW_LINE

a , m = map ( int , input ( ) . split ( ) )   t = Truefor i in range ( m ) : if a % m == 0 : t = False print ( " Yes " ) break else : x = int ( a % m ) a += xif t == True : print ( " No " ) NEW_LINE

def f ( l ) : a , m = l for i in range ( m ) : x = a % m if x == 0 : return ' Yes ' a += x return ' No '   l = list ( map ( int , input ( ) . split ( ) ) ) print ( f ( l ) )   NEW_LINE


import java . util . Scanner ;   public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int t = in . nextInt ( ) ; while ( t > 0 ) { t -- ; int n = in . nextInt ( ) ; String s = Integer . toString ( n ) ; int cnt = 0 ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { if ( s . charAt ( i ) != '0' ) ++ cnt ; } System . out . println ( cnt ) ; int cnt2 = 0 ; while ( n != 0 ) { int digit = n % 10 ; if ( digit != 0 ) { System . out . print ( ( int ) ( digit * Math . pow ( 10 , cnt2 ) ) + " ▁ " ) ; } n /= 10 ; ++ cnt2 ;   } System . out . println ( ) ; } }

import java . util . * ;   public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int t = in . nextInt ( ) ; for ( int i = 0 ; i < t ; i ++ ) { ArrayList < Integer > rounds = new ArrayList < > ( ) ; int tenth = 0 ; int n = in . nextInt ( ) ; while ( n > 0 ) { int x = ( n % 10 ) * ( int ) Math . pow ( 10 , tenth ++ ) ; if ( x > 0 ) rounds . add ( x ) ; n /= 10 ; } String s = " " ; for ( int num : rounds ) { s = s + num + " ▁ " ; } s = s . substring ( 0 , s . length ( ) - 1 ) ; System . out . println ( rounds . size ( ) ) ; System . out . println ( s ) ; }   }    }

import java . util . * ;   public class SumOfRoundNumbers { static void cal ( int n ) { String s = Integer . toString ( n ) ; int len = s . length ( ) ; int number [ ] = new int [ len ] ; for ( int i = 0 ; i < len ; i ++ ) { number [ i ] = s . charAt ( i ) - '0' ; } List < Integer > l = new ArrayList < > ( ) ; int place = len - 1 ; for ( int i = 0 ; i < len ; i ++ ) { int no = number [ i ] * ( int ) ( Math . pow ( 10 , place ) ) ; if ( no != 0 ) l . add ( no ) ; place -- ; } System . out . println ( l . size ( ) ) ; for ( int ele : l ) System . out . print ( ele + " ▁ " ) ; System . out . println ( ) ; }   public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; while ( t -- > 0 ) { int n = sc . nextInt ( ) ; cal ( n ) ; } } }

import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int n = s . nextInt ( ) ; while ( n -- > 0 ) { int t = s . nextInt ( ) ; ArrayList < Integer > l = new ArrayList < > ( ) ; int res , r = 1 , i = 0 ; while ( t > 0 ) { res = t % 10 ; if ( res != 0 ) { l . add ( res * r ) ; } t = t / 10 ; r = r * 10 ; } System . out . println ( l . size ( ) ) ; for ( int j = 0 ; j < l . size ( ) ; j ++ ) { System . out . print ( l . get ( j ) + " ▁ " ) ; } } } }

t = int ( input ( ) ) for i in range ( t ) : n = input ( ) a = n [ : : - 1 ] s = [ ] for i in range ( len ( n ) ) : if ( a [ i ] != '0' ) : s . append ( a [ i ] + '0' * i ) print ( len ( s ) ) print ( * s ) NEW_LINE

import re     def main ( ) : t = int ( input ( ) ) for _ in range ( t ) : num = input ( ) count = 0 res = [ ] for i in range ( 1 , len ( num ) + 1 ) :   if num [ i - 1 ] == "0" : continue count += 1   res . append ( num [ i - 1 ] + "0" * ( len ( num ) - i ) )   re_num = re . findall ( r " [123456789 ] " , string = num [ i : ] ) if len ( re_num ) == 0 : break   print ( f " { count } \n { ' ▁ ' . join ( res ) } " )     if __name__ == ' _ _ main _ _ ' : main ( ) NEW_LINE

number = int ( input ( ) ) for i in range ( number ) : n = input ( ) new = [ ] for i , num in enumerate ( n [ : : - 1 ] ) : if int ( num ) > 0 : new . append ( int ( num ) * 10 ** i ) print ( len ( new ) ) print ( * new , sep = " ▁ " )       NEW_LINE

t = int ( input ( ) ) for x in range ( t ) : n = input ( ) print ( len ( n ) - n . count ( "0" ) ) for x in range ( len ( n ) ) : if n [ x ] != "0" : print ( n [ x ] + "0" * ( len ( n ) - ( x + 1 ) ) , end = " ▁ " ) print ( ) NEW_LINE

from collections import Counterimport math   def solve ( ) : string = input ( ) count = 0 l = len ( string ) i = 0   array = [ ]   while ( i < l ) : if string [ i ] != "0" : count += 1 array . append ( int ( string [ i ] ) * 10 ** ( l - 1 - i ) ) i += 1 print ( count ) for i in array : print ( i , end = " ▁ " ) print ( )   for i in range ( int ( input ( ) ) ) : solve ( ) 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 c710b {

import java . util . Scanner ; public class p879B { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; long n = sc . nextInt ( ) , k = sc . nextLong ( ) ; int a [ ] = new int [ ( int ) n ] , max = - 1 , c = 0 ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = sc . nextInt ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( a [ i ] > max ) { max = a [ i ] ; c = 0 ; } if ( i > 0 ) c ++ ; if ( c >= k ) break ; } System . out . println ( max ) ; } }

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 . math . BigInteger ; 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 ( ) ; long k = input . nextLong ( ) ; ArrayList < Integer > a = new ArrayList < > ( ) ; for ( int i = 0 ; i < n ; i ++ ) { a . add ( input . nextInt ( ) ) ; } int ans [ ] = new int [ n + 1 ] ; int j = n ; if ( k >= n ) { System . out . println ( n ) ; return ; } for ( int i = 0 ; ; i ++ ) { if ( a . get ( 0 ) < a . get ( 1 ) ) { ans [ a . get ( 1 ) ] ++ ; if ( ans [ a . get ( 1 ) ] >= k ) { System . out . println ( a . get ( 1 ) ) ; return ; } int value = a . remove ( 0 ) ;

import java . lang . * ; import java . util . * ;   public class Abhishek { public static void main ( String [ ] args ) throws Exception { Scanner sc = new Scanner ( System . in ) ; long n = Long . parseLong ( sc . next ( ) ) ; long k = Long . parseLong ( sc . next ( ) ) ; Queue < Long > players = new LinkedList < > ( ) ; long max = Long . MIN_VALUE ; for ( int i = 0 ; i < n ; i ++ ) { long a = sc . nextLong ( ) ; players . add ( a ) ; max = Math . max ( a , max ) ; } if ( k >= n - 1 ) { System . out . println ( max ) ; return ; } long current = players . remove ( ) ; long c = 0 ; while ( c != k ) { long p2 = players . remove ( ) ; if ( p2 > current ) { players . add ( current ) ; current = p2 ; c = 1 ; } else { c ++ ; players . add ( p2 ) ; } } System . out . println ( current ) ;   } }

def fun ( n , k ) : n = int ( n ) k = int ( k ) a = list ( map ( int , input ( ) . split ( ) ) ) if k > n : a . sort ( ) print ( a [ - 1 ] ) exit ( 0 ) p = a [ 0 ] s = 0 for i in range ( 1 , n ) : if p > a [ i ] : s += 1 else : p = a [ i ] s = 1 if s < k : continue break print ( p ) a , b = input ( ) . split ( ) fun ( int ( a ) , int ( b ) ) NEW_LINE

import queue   n , k = map ( int , input ( ) . split ( ) ) players = list ( map ( int , input ( ) . split ( ) ) ) p1 = players [ 0 ] p2 = players [ 1 ] q = queue . Queue ( )   for i in range ( 2 , n ) : q . put ( players [ i ] )   c = 0 while True : if p1 > p2 : q . put ( p2 ) c += 1 else : q . put ( p1 ) p1 = p2 c = 1 p2 = q . get ( ) if c == k or c >= n : print ( p1 ) break NEW_LINE

playersCount , winNumber = [ int ( x ) for x in input ( ) . split ( ' ▁ ' ) ] players = [ int ( x ) for x in input ( ) . split ( ' ▁ ' ) ]   winsCount = 0 max = 0 for i in range ( 1 , playersCount ) : if players [ max ] > players [ i ] : winsCount += 1 else : winsCount = 1 max = i if winsCount >= winNumber : break   print ( players [ max ] ) NEW_LINE

n , k = map ( int , input ( ) . split ( ) )   p = list ( map ( int , input ( ) . split ( ) ) )   if k >= n - 1 : print ( max ( p ) ) exit ( 0 )   mx = - 1   for i in range ( n ) : now = ( i + 1 ) % n num = 0 if mx < p [ i ] and mx != - 1 : num = 1 for j in range ( k ) : if p [ i ] > p [ now ] : num += 1 now = ( now + 1 ) % n else : break if num >= k : print ( p [ i ] ) exit ( 0 ) mx = max ( mx , p [ i ] ) NEW_LINE