import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int q = scan . nextInt ( ) ; while ( q > 0 ) { int n = scan . nextInt ( ) ; q -- ; int a [ ] = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = scan . nextInt ( ) ; } int sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { sum += a [ i ] ; } if ( sum % n == 0 ) { System . out . println ( sum / n ) ; } else { System . out . println ( sum / n + 1 ) ; } } } }

import java . util . * ;   public class Main {   public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; int t = Integer . valueOf ( scanner . nextLine ( ) ) ; while ( t -- > 0 ) { long n = scanner . nextLong ( ) ; long sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { sum += scanner . nextLong ( ) ; } System . out . println ( sum / n + Math . min ( 1 , sum % n ) ) ; } } }

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

import java . util . * ; import java . io . * ; public class A { public static FastReader sc = new FastReader ( ) ; public static PrintWriter out = new PrintWriter ( System . out ) ; public static void taskSolver ( ) { int n = sc . nextInt ( ) ; long sum = 0 ; Integer arr [ ] = new Integer [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = sc . nextInt ( ) ; sum += arr [ i ] ; } out . println ( ( sum + n - 1 ) / n ) ; } public static void main ( String args [ ] ) throws java . lang . Exception { int t = sc . nextInt ( ) ; while ( t -- > 0 ) taskSolver ( ) ; out . close ( ) ; } 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 ; } } }

import java . io . * ; import java . math . * ; import java . util . * ;   public class Main { public static void main ( String [ ] args ) throws IOException { FastReader scan = new FastReader ( ) ; PrintWriter out = new PrintWriter ( System . out ) ; Task solver = new Task ( ) ; ans = new StringBuilder ( ) ; int T = 1 ; for ( int tt = 0 ; tt < T ; tt ++ ) solver . solve ( tt , scan , out ) ; out . close ( ) ; }   static StringBuilder ans ;   static class Task { public void solve ( int testNumber , FastReader scan , PrintWriter out ) { int q = scan . nextInt ( ) ; while ( q -- > 0 ) { int n = scan . nextInt ( ) ; double s = 0 ; for ( int i = 0 ; i < n ; i ++ ) s += scan . nextDouble ( ) ; out . println ( ( int ) Math . ceil ( s / n ) ) ; } } }   static class FastReader { BufferedReader br ; StringTokenizer st ;   public FastReader ( ) { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; }   public FastReader ( String s ) throws FileNotFoundException { br = new BufferedReader ( new FileReader ( new File ( s ) ) ) ; }   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 ; } } }

for i in range ( int ( input ( ) ) ) : n = int ( input ( ) ) items = list ( map ( int , input ( ) . split ( " ▁ " ) ) ) a = sum ( items ) ans = a // n if a % n != 0 : ans += 1 print ( ans ) NEW_LINE

t = int ( input ( ) ) for _ in range ( t ) : n = int ( input ( ) ) x = list ( map ( int , input ( ) . split ( ) ) ) s = sum ( x ) if s % n == 0 : k = s // n else : k = s // n + 1 print ( k ) NEW_LINE

import mathfor t in range ( int ( input ( ) ) ) : n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) print ( math . ceil ( sum ( a ) / n ) ) NEW_LINE


import java . io . PrintWriter ; import java . util . * ; import java . lang . * ; public class Main { static int po ( int n ) { int a = 2 ; int res = 1 ; while ( n > 0 ) { if ( n % 2 == 0 ) { res *= a ; n -- ; } else { a *= a ; n /= 2 ; } } return res ; } static long f ( long num ) { HashSet < Long > h = new HashSet < > ( ) ; int res = 0 , flag = 1 ; while ( num > 0 ) { long n = num % 10 ; if ( ! h . contains ( n ) ) { h . add ( n ) ; num /= 10 ; res += n ; } else { flag = 0 ; break ; } } if ( flag == 0 ) { return - 1 ; } return res ; } public static void main ( String [ ] args ) { PrintWriter out1 = new PrintWriter ( System . out ) ; Scanner sc = new Scanner ( System . in ) ;

import java . util . Scanner ;   public class Main { public static void main ( String [ ] args ) { try ( Scanner input = new Scanner ( System . in ) ) { long n = input . nextLong ( ) ; long m = input . nextLong ( ) ; long a = 0 ; long largestInterval = getLargestInterval ( n , m ) ; if ( largestInterval == 0 ) { a = 1 ; } else if ( largestInterval == m - 1 ) { a = m - 1 ; } else { a = m + 1 ; } System . out . println ( a ) ; } }   private static long getLargestInterval ( long n , long m ) { return Math . max ( n - m , m - 1 ) ; } }

import java . util . Scanner ;   public class P570B { public static void main ( String [ ] args ) {   Scanner s = new Scanner ( System . in ) ; int n = s . nextInt ( ) ; int m = s . nextInt ( ) ; if ( n == 1 ) { System . out . println ( 1 ) ; } else { if ( n - m > m - 1 ) { System . out . println ( m + 1 ) ; } else { System . out . println ( m - 1 ) ; } }   }   }

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

n , m = map ( int , input ( ) . split ( ) ) if n == 1 : print ( 1 ) else : print ( m - 1 if m - 1 >= n - m else m + 1 ) NEW_LINE

n , m = map ( int , input ( ) . split ( ) ) if n == 1 : print ( 1 ) elif m - 1 < n - m : print ( m + 1 ) else : print ( m - 1 ) NEW_LINE

n , m = map ( int , input ( ) . split ( ) ) a = min ( m + 1 , n ) b = max ( m - 1 , 1 ) a = ( n - a + 1 ) - ( m == n ) b = b - ( m == 1 ) if b >= a : print ( max ( m - 1 , 1 ) ) else : print ( min ( m + 1 , n ) ) NEW_LINE

arr = list ( map ( int , input ( ) . split ( ) ) ) n = arr [ 0 ] m = arr [ 1 ] if ( n == 1 ) : print ( 1 ) elif ( n % 2 == 0 ) : if ( m == n / 2 ) : print ( m + 1 ) elif ( m == ( n / 2 + 1 ) ) : print ( m - 1 ) elif ( m < ( n / 2 ) ) : print ( m + 1 ) else : print ( m - 1 ) else : k = ( n + 1 ) / 2 if ( m == k ) : print ( m - 1 ) elif ( m < k ) : print ( m + 1 ) else : print ( m - 1 ) NEW_LINE


import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int x = sc . nextInt ( ) ; int h = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int c = 0 ; while ( h % 10 != 7 && m % 10 != 7 ) { c ++ ; m -= x ; if ( m < 0 ) { m += 60 ; h -= 1 ; } if ( h < 0 ) h = 23 ; } System . out . println ( c ) ; } }

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

import java . util . * ; import java . util . stream . * ; public class Solution { public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int x = scan . nextInt ( ) ; int hh = scan . nextInt ( ) ; int mm = scan . nextInt ( ) ; int result = 0 ; while ( ! happy ( hh , mm ) ) { if ( mm >= x ) { mm -= x ; } else { mm = 60 - ( x - mm ) ; if ( hh > 0 ) { hh -- ; } else { hh = 23 ; } } result ++ ; } System . out . println ( result ) ; } private static boolean happy ( Integer hh , Integer mm ) { return hh . toString ( ) . contains ( "7" ) || mm . toString ( ) . contains ( "7" ) ; } }

import datetime   n = int ( input ( ) ) a , b = input ( ) . split ( )   x = datetime . timedelta ( hours = int ( a ) , minutes = int ( b ) ) c = 0 while '7' not in str ( x ) : x -= datetime . timedelta ( hours = 0 , minutes = n ) c += 1   print ( c ) NEW_LINE

def decrease ( h , m , x ) : if m >= x : m -= x else : m = 60 - ( x - m ) if h == 0 : h = 23 elif h <= 1 : h = 24 - ( h - 1 ) else : h -= 1 return [ h , m ]       def solve ( h , m , x ) : count = 0 v = [ 7 , 17 , 27 , 37 , 47 , 57 ] while True : if h in v or m in v : return count h , m = decrease ( h , m , x ) count += 1                                         def main ( ) : x = int ( input ( ) ) arr = list ( map ( int , input ( ) . split ( ' ▁ ' ) ) ) NEW_LINE

x = int ( input ( ) ) h , m = map ( int , input ( ) . split ( ) )   y = 0 while 1 : if str ( h ) . find ( '7' ) >= 0 or str ( m ) . find ( '7' ) >= 0 : break   y += 1 m -= x if m < 0 : h -= 1 m += 60 if h < 0 : h += 24   print ( y ) NEW_LINE

x = int ( input ( ) ) h , m = map ( int , input ( ) . split ( ) ) c = 0   if '7' in str ( h ) or '7' in str ( m ) : print ( 0 ) else : while True : if ( m - x ) >= 0 : m = m - x c = c + 1 else : m = 60 - ( abs ( m - x ) ) if h == 0 : h = 23 else : h = h - 1 c = c + 1 d = str ( h ) f = str ( m ) if '7' in d or '7' in f : break print ( c ) NEW_LINE


import java . util . * ;   public class Solution {    public static void main ( String args [ ] ) { Scanner in = new Scanner ( System . in ) ; int testCases = in . nextInt ( ) ; in . nextLine ( ) ; for ( int i = 0 ; i < testCases ; i ++ ) { int n = in . nextInt ( ) ; int k = in . nextInt ( ) ; in . nextLine ( ) ; int result = 0 ; if ( n < k ) { result = k - n ; } else { result = ( ( n - k ) % 2 == 0 ) ? 0 : 1 ; } System . out . println ( result ) ; } } }

import java . util . * ; import java . io . * ; import java . lang . Math ;    public class A { public static void main ( String args [ ] ) { PrintWriter out = new PrintWriter ( System . out ) ; FastScanner fs = new FastScanner ( ) ; int t = fs . nextInt ( ) ; for ( int test_case = 1 ; test_case <= t ; test_case ++ ) { int n = fs . nextInt ( ) , k = fs . nextInt ( ) ; if ( n < k ) { System . out . println ( k - n ) ; } else { if ( k % 2 == 0 && n % 2 == 0 ) { System . out . println ( 0 ) ; } else if ( k % 2 == 1 && n % 2 == 1 ) { System . out . println ( 0 ) ; } else { System . out . println ( 1 ) ; } } } out . close ( ) ; } static class Pair implements Comparable < Pair > { int first , second ; public Pair ( int x , int y ) { first = x ; second = y ; } public int compareTo ( Pair x ) { if ( this . first < x . first ) return - 1 ; if ( this . first == x . first ) return this . second < x . second ? - 1 : ( this . second == x . second ? 0 : 1 ) ; return 1 ; } } static class RangeMin { long logs [ ] , st [ ] [ ] ; int N , K ; public RangeMin ( int n ) { N = n ; K = ( int ) ( ( double ) ( Math . log10 ( ( double ) n ) / ( double ) Math . log10 ( ( double ) 2 ) ) ) ; st = new long [ N + 2 ] [ K + 2 ] ; logs = new long [ N + 2 ] ; } void init ( ArrayList < Integer > A ) { for ( int i = 0 ; i < N ; i ++ ) { Arrays . fill ( st [ i ] , ( long ) 1e18 ) ; st [ i ] [ 0 ] = ( long ) A . get ( i ) ; }

import java . util . Scanner ;   public class A1401 {   public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int T = in . nextInt ( ) ; for ( int t = 0 ; t < T ; t ++ ) { int N = in . nextInt ( ) ; int K = in . nextInt ( ) ; int answer = 0 ; if ( ( N % 2 == 0 ) != ( K % 2 == 0 ) ) { N ++ ; answer ++ ; } answer += Math . max ( 0 , K - N ) ; System . out . println ( answer ) ; } }   }

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

t = int ( input ( ) ) for _ in range ( t ) : n , k = list ( map ( int , input ( ) . split ( ) ) ) if n <= k : print ( k - n ) else : if ( n + k ) % 2 == 0 : print ( 0 ) else : print ( 1 ) NEW_LINE

num_times = int ( input ( ) ) for i in range ( num_times ) : n , k = input ( ) . split ( ) n = int ( n ) k = int ( k ) if n % 2 == 0 : if k > n : print ( k - n ) elif k <= n and k % 2 == 0 : print ( 0 ) elif k <= n and k % 2 != 0 : print ( 1 ) elif n % 2 != 0 : if k > n : print ( k - n ) if k % 2 != 0 and k <= n : print ( 0 ) elif k % 2 == 0 and k <= n : print ( 1 )                         NEW_LINE

from sys import stdin , stdout   def main ( ) : for _ in range ( int ( stdin . readline ( ) ) ) : n , k = map ( int , stdin . readline ( ) . split ( ' ▁ ' ) ) if n <= k : stdout . write ( str ( k - n ) + ' \n ' ) else : stdout . write ( str ( ( n - k ) % 2 ) + ' \n ' )   if __name__ == " _ _ main _ _ " : main ( ) NEW_LINE

t = int ( input ( ) ) for i in range ( t ) : a , b = map ( int , input ( ) . split ( ) ) if ( a < b ) : print ( b - a ) else : print ( ( a - b ) % 2 ) NEW_LINE


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

import java . util . * ;   public class Try { public static void main ( String args [ ] ) { Scanner br = new Scanner ( System . in ) ; int t = br . nextInt ( ) ; while ( t -- > 0 ) { int n = br . nextInt ( ) ; int a = br . nextInt ( ) ; int b = br . nextInt ( ) ; int ch = 96 ; while ( n -- != 0 ) { ++ ch ; System . out . print ( ( char ) ch ) ; if ( 96 + b == ch ) ch = 96 ; } System . out . println ( ) ; } } }

import java . util . * ; public class P2 {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; String s = " abcdefghijklmnopqrstuvwxyz " ; while ( t -- > 0 ) { int n = sc . nextInt ( ) ; int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; if ( a == b ) { String m = " " ; for ( int j = 0 ; j < n ; j ++ ) { m += s . charAt ( j % 26 ) ; } System . out . println ( m ) ; } else if ( n == a ) { String f = " " ; for ( int i = 0 ; i < n - b + 1 ; i ++ ) { f += ' a ' ; } f += s . substring ( 1 , b ) ; System . out . println ( f ) ; } else if ( b == 1 ) { String f = " " ; for ( int i = 0 ; i < n ; i ++ ) { f += ' a ' ; } System . out . println ( f ) ; } else { String m = " " ; for ( int j = 0 ; j < a ; j ++ ) { m += s . charAt ( j % 26 ) ; } String ret = " " ; for ( int i = 0 ; i < a - b + 1 ; i ++ ) { ret += ' a ' ; } ret += m . substring ( 1 , b ) ;   String f = ret ; for ( int i = 0 ; i < n - ret . length ( ) ; i ++ ) { f += ret . charAt ( i % a ) ; } System . out . println ( f ) ;   } } } }

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Arrays ;   public class CF1335B { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; int t = Integer . parseInt ( br . readLine ( ) ) ; while ( t -- > 0 ) { int [ ] nab = Arrays . stream ( br . readLine ( ) . split ( " \\ s + " ) ) . mapToInt ( Integer :: parseInt ) . toArray ( ) ; int i = 0 ; while ( i < nab [ 0 ] ) { System . out . print ( ( char ) ( ' a ' + ( i ++ % nab [ 2 ] ) ) ) ; } System . out . println ( ) ; }   } }

t = int ( input ( ) ) for j in range ( t ) : n , a , b = map ( int , input ( ) . split ( ) ) x , res = ord ( ' a ' ) , ' ' for i in range ( a - b + 1 ) : res += chr ( x ) for i in range ( b - 1 ) : x += 1 res += chr ( x ) NEW_LINE

for i in range ( int ( input ( ) ) ) : n , a , b = map ( int , input ( ) . split ( ) ) s1 = ' qwertyuiopasdfghjklzxcvbnm ' s2 = s1 [ : b ] s3 = s2 * ( n // b ) + s2 [ : n % b ] print ( s3 ) NEW_LINE

from math import ceil   t = int ( input ( ) )   l = ' zyxwvutsrqponmlkjihgfedcba ' for i in range ( t ) : n , a , b = map ( int , input ( ) . split ( ) )   x = l [ : b ] x = ( x * ceil ( a / b ) ) [ : a ] x = ( x * ceil ( n / a ) ) [ : n ]   print ( x ) NEW_LINE

for i in range ( int ( input ( ) ) ) : n , a , b = map ( int , input ( ) . split ( ) ) s = ' abcdefghijklmnopqrstuvwxyz ' res = s [ 0 : b ] * ( n // b ) c = n - len ( res ) print ( res + s [ 0 : c ] ) NEW_LINE


import java . util . Scanner ;   public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; StringBuilder SB = new StringBuilder ( ) ; int n = in . nextInt ( ) ; if ( n % 2 == 0 ) { int k = n / 2 ; System . out . println ( ( k ) * n ) ;   for ( int i = 1 ; i <= k ; i ++ ) {   for ( int j = 1 ; j <= k ; j ++ ) { SB . append ( " C . " ) ;   } SB . append ( " \r \n " ) ;    for ( int j = 1 ; j <= k ; j ++ ) { SB . append ( " . C " ) ; } SB . append ( " \r \n " ) ;   } } else { int k = n / 2 ; System . out . println ( ( k + 1 ) * ( ( k ) + 1 ) + ( k ) * ( k ) ) ; for ( int i = 1 ; i <= k ; i ++ ) { for ( int j = 1 ; j <= k ; j ++ ) { SB . append ( " C . " ) ; } SB . append ( " C " ) ; SB . append ( " \r \n " ) ; for ( int j = 1 ; j <= k ; j ++ ) { SB . append ( " . C " ) ; } SB . append ( " . " ) ; SB . append ( " \r \n " ) ; }   for ( int j = 1 ; j <= k ; j ++ ) { SB . append ( " C . " ) ; } SB . append ( " C " ) ; SB . append ( " \r \n " ) ; } System . out . println ( SB ) ; } }

import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) ; System . out . println ( ( n * n + 1 ) / 2 ) ; for ( int i = 0 ; i < n ; i ++ ) { StringBuilder sb = new StringBuilder ( ) ; for ( int j = 0 ; j < n ; j ++ ) { if ( ( i + j ) % 2 == 0 ) sb . append ( " C " ) ; else sb . append ( " . " ) ; } System . out . println ( sb ) ; } in . close ( ) ; } }

import java . util . Scanner ;   public class Main { public static void main ( String args [ ] ) { Scanner in = new Scanner ( System . in ) ; while ( in . hasNext ( ) ) { int n = in . nextInt ( ) ; int code = ( n * n + 1 ) / 2 ; System . out . println ( code ) ; for ( int i = 0 ; i < n ; i ++ ) { StringBuffer stringBuffer = new StringBuffer ( ) ; for ( int j = 0 ; j < n ; j ++ ) { if ( ( i + j + 2 ) % 2 == 0 ) stringBuffer . append ( ' C ' ) ; else stringBuffer . append ( ' . ' ) ; } System . out . println ( stringBuffer ) ; } } }   }

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

import java . math . BigInteger ; import java . util . * ; import java . lang . * ; import java . util . Arrays ;      public class geek {    public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; try {        StringBuffer sb = new StringBuffer ( ) ; int n = s . nextInt ( ) ;   int j = 0 , ans = 0 ; for ( int i = 0 ; i < n ; i ++ ) { j = 0 ; if ( i % 2 == 0 ) {   while ( j < n ) { sb . append ( " C " ) ; ans ++ ; j ++ ; if ( j < n ) { sb . append ( " . " ) ; j ++ ; } } } else {    while ( j < n ) { sb . append ( " . " ) ; j ++ ; if ( j < n ) { sb . append ( " C " ) ; ans ++ ; j ++ ; } } } sb . append ( " \n " ) ;   } System . out . println ( ans + " \n " + sb ) ;

n = int ( input ( ) )     if ( n % 2 ) != 0 : print ( ( n * n // 2 ) + 1 ) else : print ( n * n // 2 ) for i in range ( n ) : rep = ' ' for j in range ( n ) : if i % 2 == 0 : if j % 2 == 0 : rep += ' C ' else : rep += ' . ' else : if j % 2 != 0 : rep += ' C ' else : rep += ' . ' print ( rep ) NEW_LINE

n = int ( input ( ) ) if n % 2 == 0 : print ( n ** 2 // 2 ) for i in range ( n ) : if i % 2 == 0 : print ( ' C . ' * ( n // 2 ) ) else : print ( ' . C ' * ( n // 2 ) ) else : print ( n ** 2 // 2 + 1 ) for i in range ( n ) : if i % 2 == 0 : print ( ' C . ' * ( n // 2 ) + ' C ' ) else : print ( ' . C ' * ( n // 2 ) + ' . ' ) NEW_LINE

import sysfrom math import ceil   def main ( ) : n = int ( sys . stdin . read ( ) . strip ( ) ) t = int ( ceil ( n / 2 ) ) return t * n - n % t , ' \n ' . join ( ' ' . join ( ' . C ' [ not ( i + j ) % 2 ] for j in range ( n ) ) for i in range ( n ) ) print ( * main ( ) , sep = ' \n ' ) NEW_LINE

def main_function ( ) : n = int ( input ( ) ) output_list = [ ] count = 0 for i in range ( n ) : lis = [ ] if not i % 2 : for j in range ( n ) : if not j % 2 : lis . append ( " C " ) count += 1 else : lis . append ( " . " ) else : for j in range ( n ) : if not j % 2 : lis . append ( " . " ) else : lis . append ( " C " ) count += 1 s = " " . join ( lis ) output_list . append ( s ) return str ( count ) + " \n " + " \n " . join ( output_list )           print ( main_function ( ) ) NEW_LINE


import java . util . * ; import java . io . * ; import java . math . * ; public class Solution { public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; PrintWriter out = new PrintWriter ( System . out ) ; StringTokenizer st = new StringTokenizer ( br . readLine ( ) ) ; int n = Integer . parseInt ( st . nextToken ( ) ) ; long k = Long . parseLong ( st . nextToken ( ) ) ; if ( n == 1 ) out . println ( "1" ) ; else { long [ ] tab = new long [ n ] ; tab [ 0 ] = ( long ) 0 ; tab [ 1 ] = ( long ) 0 ; for ( int i = 2 ; i < n ; i ++ ) {

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

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 . HashMap ; import java . util . Objects ; import java . util . Random ; import java . util . StringTokenizer ; import java . util . TreeSet ;   public class Solution { static final int maxn = ( int ) 1e5 + 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 ( ) ; long k = fs . nextLong ( ) ; long [ ] fib = new long [ n + 1 ] ; fib [ 0 ] = 1 ; fib [ 1 ] = 1 ; for ( int i = 2 ; i <= n ; i ++ ) fib [ i ] = fib [ i - 1 ] + fib [ i - 2 ] ; int idx = 0 ; int [ ] res = new int [ n ] ; while ( idx < n ) { if ( k <= fib [ n - idx - 1 ] ) { res [ idx ] = idx + 1 ; idx ++ ; } else { k -= fib [ n - idx - 1 ] ; res [ idx ] = idx + 2 ; res [ idx + 1 ] = idx + 1 ; idx += 2 ; } } for ( int i = 0 ; i < n ; i ++ ) out . print ( res [ i ] + " ▁ " ) ; out . println ( ) ; } out . close ( ) ; } static final Random random = new Random ( ) ; static void ruffleSort ( int [ ] a ) { int n = a . length ;

n , k = map ( int , input ( ) . split ( ) ) a = [ 0 for i in range ( n + 1 ) ] a [ 0 ] , a [ 1 ] = 1 , 1 for i in range ( 2 , n + 1 ) : a [ i ] = a [ i - 1 ] + a [ i - 2 ] p = [ i + 1 for i in range ( n ) ] i = 0 while i < n : if k > a [ n - 1 - i ] : p [ i ] , p [ i + 1 ] = p [ i + 1 ] , p [ i ] k -= a [ n - 1 - i ] i += 2 else : i += 1 p = [ str ( i ) for i in p ] print ( ' ▁ ' . join ( p ) )   NEW_LINE

n , m = [ int ( x ) for x in input ( ) . split ( ) ] F = [ 1 , 1 ] for i in range ( 2 , n ) : F . append ( F [ - 1 ] + F [ - 2 ] ) perm = [ i + 1 for i in range ( n ) ] for i in range ( n ) : if m > F [ n - 1 - i ] : m -= F [ n - 1 - i ] perm [ i ] , perm [ i + 1 ] = perm [ i + 1 ] , perm [ i ] for k in perm : print ( k , end = ' ▁ ' ) NEW_LINE

n , k = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE


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

import java . util . * ;   public class questionCF {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; int a [ ] = new int [ m ] ; if ( n % m == 0 ) { for ( int i = 0 ; i < m ; i ++ ) System . out . print ( n / m + " ▁ " ) ; return ; } while ( true ) { for ( int i = m - 1 ; i >= 0 ; i -- ) { a [ i ] += 1 ; -- n ; if ( n == 0 ) { for ( int k = 0 ; k < m ; k ++ ) System . out . print ( a [ k ] + " ▁ " ) ; return ; } } } } }

import java . util . * ; public class P2 {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int m = sc . nextInt ( ) ; while ( n % m != 0 ) { int p = n / m ; System . out . print ( p + " ▁ " ) ; n -= p ; m -- ; } for ( int i = 0 ; i < m ; i ++ ) { System . out . print ( n / m + " ▁ " ) ; } } }

import java . util . * ; public class Sol { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int n = s . nextInt ( ) , m = s . nextInt ( ) , t = m ; for ( int i = 0 ; i < t ; i ++ ) { System . out . print ( n / m + " ▁ " ) ; n -= n / m ; -- m ; } } }

n , m = list ( map ( int , input ( ) . split ( ) ) ) print ( * ( [ n // m ] * ( m - n % m ) + [ n // m + 1 ] * ( n % m ) ) ) NEW_LINE

n , m = map ( int , input ( ) . split ( ) )   if n >= m : m_list = [ 0 ] * m adding = n // m sub_adding = n % m for i in range ( adding ) : for j in range ( len ( m_list ) ) : m_list [ j ] += 1 for k in range ( sub_adding ) : m_list [ k ] += 1 for l in m_list : print ( l , sep = " ▁ " , end = " ▁ " ) NEW_LINE

from sys import stdin , stdout   def main ( ) : n , m = map ( int , stdin . readline ( ) . split ( ' ▁ ' ) ) q , r = n // m , n % m s = [ q for i in range ( m - r ) ] s . extend ( [ ( q + 1 ) for i in range ( m - r , m ) ] ) print ( * s , sep = ' ▁ ' )   if __name__ == " _ _ main _ _ " : main ( ) NEW_LINE

n , m = input ( ) . split ( ) n = int ( n ) m = int ( m ) q = n // mr = n % mlst = [ ] for i in range ( m ) : if ( i < m - r ) : lst . append ( q ) else : lst . append ( q + 1 ) print ( * lst ) NEW_LINE


import java . util . Scanner ; public class MammothSGenomeDecoding {   public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; int arr [ ] = new int [ 5 ] ;

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

n = int ( input ( ) )   s = input ( )   a = s . count ( ' A ' ) g = s . count ( ' G ' ) c = s . count ( ' C ' ) t = s . count ( ' T ' )     if n % 4 != 0 or a > n // 4 or g > n // 4 or c > n // 4 or t > n // 4 : print ( " = = = " ) else : a = n // 4 - a g = n // 4 - g c = n // 4 - c t = n // 4 - t     s = list ( s ) for i in range ( n ) : if s [ i ] == ' ? ' : if a : s [ i ] = ' A ' a -= 1 elif g : s [ i ] = ' G ' g -= 1 elif c : s [ i ] = ' C ' c -= 1 else : s [ i ] = ' T ' t -= 1     print ( ' ' . join ( s ) ) NEW_LINE

n = int ( input ( ) ) s = input ( ) f = 0 if ( n % 4 != 0 ) : print ( ' = = = ' ) else : gnm = { } gnm [ ' A ' ] = s . count ( ' A ' ) gnm [ ' C ' ] = s . count ( ' C ' ) gnm [ ' G ' ] = s . count ( ' G ' ) gnm [ ' T ' ] = s . count ( ' T ' ) num = n // 4 for i in gnm : if gnm . get ( i ) > num and i != ' ? ' : f = 1 print ( ' = = = ' ) break else : gnm [ i ] = num - gnm . get ( i ) if f == 0 : s = s . replace ( ' ? ' , ' A ' , gnm [ ' A ' ] ) . replace ( ' ? ' , ' C ' , gnm [ ' C ' ] ) . replace ( ' ? ' , ' G ' , gnm [ ' G ' ] ) . replace ( ' ? ' , ' T ' , gnm [ ' T ' ] ) print ( s ) NEW_LINE

n = int ( input ( ) ) genomes = list ( input ( ) ) if n % 4 != 0 or any ( [ genomes . count ( x ) > n // 4 for x in ' ACGT ' ] ) : print ( ' = = = ' ) else : cnt = { } for x in ' ACGT ' : cnt [ x ] = n // 4 - genomes . count ( x ) for i in range ( n ) : if genomes [ i ] == ' ? ' : for x in ' ACGT ' : if cnt [ x ] > 0 : genomes [ i ] = x cnt [ x ] -= 1 break print ( ' ' . join ( genomes ) ) NEW_LINE


import java . util . Scanner ;   public class _0700DiverseSubstring {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; sc . nextLine ( ) ; String s = sc . nextLine ( ) ; int val = n / 2 ; char prev = ' # ' ; for ( int i = 0 ; i < n ; i ++ ) { char curr = s . charAt ( i ) ; if ( i == 0 ) { prev = curr ; continue ; } else if ( prev != curr ) { System . out . println ( " YES " ) ; System . out . println ( prev + " " + curr ) ; return ; } prev = curr ; } System . out . println ( " NO " ) ; }   }

import java . util . Scanner ;   public class DiverseSubS { public static void main ( String [ ] args ) {   Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) , i ; String s = in . next ( ) , o = " NO " ; in . close ( ) ;   for ( i = 0 ; i < n - 1 ; i ++ ) if ( s . charAt ( i ) != s . charAt ( i + 1 ) ) { o = " YES \n " + s . substring ( i , i + 2 ) ; break ; } System . out . println ( o ) ; } }

import java . util . * ; public class Main { public static void main ( String args [ ] ) { Scanner s = new Scanner ( System . in ) ; int n = s . nextInt ( ) ; String str = s . next ( ) ; for ( int i = 1 ; i < n ; i ++ ) { if ( str . charAt ( i ) != str . charAt ( i - 1 ) ) { StringBuilder sb = new StringBuilder ( ) ; sb . append ( str . charAt ( i - 1 ) ) ; sb . append ( str . charAt ( i ) ) ; System . out . println ( " YES " ) ; System . out . println ( sb ) ; return ; } } System . out . println ( " NO " ) ; } }

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

n = int ( input ( ) ) s = input ( ) ans = " "   for i in range ( n - 1 ) : if s [ i ] != s [ i + 1 ] : ans = s [ i : i + 2 ] break       if ans : print ( " YES " ) print ( ans )   else : print ( " NO " ) NEW_LINE

x = int ( input ( ) ) s = input ( ) N = 0 for i in range ( x - 1 ) : if s [ i ] != s [ i + 1 ] : print ( " YES " ) print ( s [ i ] + s [ i + 1 ] ) N = 1 breakif N == 0 : print ( " NO " ) NEW_LINE

import sysinput = sys . stdin . readline   n = int ( input ( ) ) s = input ( ) for i in range ( n - 1 ) : if s [ i ] != s [ i + 1 ] : print ( " YES " ) print ( s [ i ] , s [ i + 1 ] , sep = " " ) exit ( ) print ( " NO " ) NEW_LINE

import sysinput = sys . stdin . readline   n = int ( input ( ) ) s = input ( ) for i in range ( n - 1 ) : if s [ i ] != s [ i + 1 ] : print ( " YES " ) print ( s [ i ] , s [ i + 1 ] , sep = " " ) sys . exit ( ) print ( " NO " ) NEW_LINE

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


import java . io . * ; import java . util . * ; public class Solution { public static void main ( String [ ] args ) throws Exception { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; PrintWriter out = new PrintWriter ( System . out ) ; int t = Integer . parseInt ( br . readLine ( ) ) ; while ( t > 0 ) { t -- ; int n = Integer . parseInt ( br . readLine ( ) ) ; StringTokenizer st = new StringTokenizer ( br . readLine ( ) ) ; int [ ] a = new int [ n ] ; int sum = 0 ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = Integer . parseInt ( st . nextToken ( ) ) ; sum += a [ i ] ; } if ( sum % n != 0 ) { out . println ( - 1 ) ; continue ; } out . println ( ( 3 * n - 3 ) ) ; for ( int i = 1 ; i < n ; i ++ ) { int need = a [ i ] % ( i + 1 ) ; if ( need > 0 ) need = ( i + 1 ) - need ; a [ 0 ] -= need ; a [ i ] += need ; out . println ( 1 + " ▁ " + ( i + 1 ) + " ▁ " + need ) ; need = a [ i ] ; a [ 0 ] += need ; out . println ( ( i + 1 ) + " ▁ " + 1 + " ▁ " + ( need / ( i + 1 ) ) ) ; } int fact = a [ 0 ] / n ; for ( int i = 1 ; i < n ; i ++ ) { out . println ( 1 + " ▁ " + ( i + 1 ) + " ▁ " + fact ) ; } } out . close ( ) ; } }

import sys , math   t = int ( input ( ) ) NEW_LINE for i in range ( t ) : n = int ( input ( ) ) NEW_LINE arr = list ( map ( int , sys . stdin . readline ( ) . strip ( ) . split ( ) ) ) NEW_LINE S = sum ( arr ) NEW_LINE if S % n : NEW_LINE INDENT print ( - 1 ) else : NEW_LINE out = [ ] NEW_LINE DEDENT for i in range ( 1 , n ) : if NEW_LINE arr [ i ] % ( i + 1 ) == 0 : x = arr [ i ] // ( i + 1 ) NEW_LINE arr [ i ] -= ( x * ( i + 1 ) ) NEW_LINE arr [ 0 ] += ( x * ( i + 1 ) ) NEW_LINE out . append ( " { } ▁ { } ▁ { } \n " . format ( i + 1 , 1 , x ) ) NEW_LINE

import osimport NEW_LINE sysfrom NEW_LINE io NEW_LINE import BytesIO , IOBase NEW_LINE

for _ in range ( int ( input ( ) ) ) : n = int ( input ( ) ) NEW_LINE a = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE s = sum ( a ) NEW_LINE if s % n != 0 : print ( - 1 ) ; continue NEW_LINE t = s // n NEW_LINE print ( 3 * ( n - 1 ) ) NEW_LINE for i in range ( 1 , n ) : x = ( i + 1 ) - a [ i ] % ( i + 1 ) NEW_LINE if a [ i ] % ( i + 1 ) == 0 : x = 0 NEW_LINE a [ i ] += x NEW_LINE print ( 1 , i + 1 , x ) NEW_LINE print ( i + 1 , 1 , a [ i ] // ( i + 1 ) ) NEW_LINE for i in range ( 1 , n ) : print ( 1 , i + 1 , t ) NEW_LINE

def main ( ) : t = int ( input ( ) ) NEW_LINE for _ in range ( t ) : n = int ( input ( ) ) NEW_LINE a = [ 0 ] + readIntArr ( ) NEW_LINE


import java . util . Scanner ;   public class practice { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; int n = input . nextInt ( ) ; int [ ] distances = new int [ n + 1 ] ; for ( int i = 1 ; i <= n ; i ++ ) distances [ i ] = input . nextInt ( ) ; int s = input . nextInt ( ) ; int t = input . nextInt ( ) ; int countForward = 0 , countBackward = 0 ; if ( s < t ) { for ( int i = s ; i < t ; i ++ ) countForward += distances [ i ] ; for ( int i = t ; i != s ; i ++ ) { countBackward += distances [ i ] ; if ( i == n ) i = 0 ; } } if ( s > t ) { for ( int i = t ; i < s ; i ++ ) countBackward += distances [ i ] ; for ( int i = s ; i != t ; i ++ ) { countForward += distances [ i ] ; if ( i == n ) i = 0 ; } } System . out . println ( ( countBackward > countForward ) ? countForward : countBackward ) ; }   }

import java . util . Scanner ;   public class CircleLine { public static void main ( String [ ] args ) {   Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) , d [ ] = new int [ n ] , i , d1 = 0 , d2 = 0 ;   for ( i = 0 ; i < n ; i ++ ) { d [ i ] = in . nextInt ( ) ; } int s = in . nextInt ( ) - 1 , t = in . nextInt ( ) - 1 , j = s ; while ( j != t ) { d1 += d [ j ] ; j ++ ; if ( j >= n ) { j = 0 ; } } while ( s != t ) { s -- ; if ( s < 0 ) { s = n - 1 ; } d2 += d [ s ] ; } in . close ( ) ; System . out . println ( Math . min ( d1 , d2 ) ) ; } }

import java . io . BufferedOutputStream ; import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . math . BigInteger ;   import java . util . ArrayList ; import java . util . Collections ; import java . util . HashMap ; import java . util . StringTokenizer ;     public class Main {   public static PrintWriter out = new PrintWriter ( new BufferedOutputStream ( System . out ) ) ;   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 [ ] nextSArray ( ) { String sr [ ] = null ; try { sr = br . readLine ( ) . trim ( ) . split ( " ▁ " ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return sr ; }   String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; }   return str ; } }

import java . lang . * ; import java . util . * ; import java . io . * ; public class test { int d [ ] ; Scanner sc = new Scanner ( System . in ) ; PrintWriter pr = new PrintWriter ( System . out , true ) ; public static void main ( String ... args ) { test c = new test ( ) ; c . prop ( ) ; } public void prop ( ) { int n , s , t , min = 0 ; n = sc . nextInt ( ) ; d = new int [ n ] ; for ( int i = 2 ; i <= n + 1 ; ++ i ) { d [ i % n ] = sc . nextInt ( ) ; } s = sc . nextInt ( ) ; t = sc . nextInt ( ) ; int sum = 0 ; if ( t == n ) t = 0 ; if ( s == n ) s = 0 ; if ( s != t ) { for ( int i = s + 1 ; ; ++ i ) { sum += d [ i % n ] ; if ( i % n == t ) break ; } min = sum ; sum = 0 ; for ( int i = s ; ; -- i ) { if ( i < 0 ) sum += d [ ( n + i ) % n ] ; else sum += d [ i % n ] ;   if ( ( n + ( i - 1 ) ) % n == t ) break ; } if ( min > sum ) min = sum ; pr . println ( min ) ; } else pr . println ( 0 ) ; } }

import java . util . Scanner ;   public class practice { public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; int n = input . nextInt ( ) ; int [ ] distances = new int [ n + 1 ] ; for ( int i = 1 ; i <= n ; i ++ ) { distances [ i ] = input . nextInt ( ) + distances [ i - 1 ] ; } int s = input . nextInt ( ) ; int t = input . nextInt ( ) ; if ( s > t ) { int temp = s ; s = t ; t = temp ; } int dis = Math . min ( distances [ t - 1 ] - distances [ s - 1 ] , distances [ n ] - distances [ t - 1 ] + distances [ s - 1 ] ) ; System . out . println ( dis ) ; }   }

n = int ( input ( ) ) d = list ( map ( int , input ( ) . split ( ) ) ) s , t = sorted ( map ( int , input ( ) . split ( ) ) ) result1 = 0 result2 = d [ n - 1 ] for i in range ( s - 1 , t - 1 ) : result1 += d [ i ] for i in range ( s - 1 ) : result2 += d [ i ] for i in range ( t - 1 , n - 1 ) : result2 += d [ i ] print ( min ( result1 , result2 ) ) NEW_LINE

n = int ( input ( ) ) d = [ int ( item ) for item in input ( ) . split ( ) ] s , t = [ int ( item ) for item in input ( ) . split ( ) ] ss = min ( s , t ) - 1 tt = max ( s , t ) - 1 dist1 = sum ( d [ ss : tt ] )   print ( min ( sum ( d ) - dist1 , dist1 ) ) NEW_LINE

a = int ( input ( ) ) b = list ( map ( int , input ( ) . split ( ) ) ) c , d = sorted ( map ( int , input ( ) . split ( ) ) ) x = sum ( b [ c - 1 : d - 1 ] ) cnt = 0 print ( min ( x , sum ( b ) - x ) ) NEW_LINE

import sysimport collections   input = sys . stdin . readline   def printnl ( val ) : sys . stdout . write ( str ( val ) + ' \n ' )   n = int ( input ( ) ) d = list ( map ( int , input ( ) . split ( ) ) ) res = sum ( d ) s , t = map ( int , input ( ) . split ( ) ) s -= 1 t -= 1   ans1 , ans2 = 0 , 0   if s == t : print ( 0 ) elif s < t : now = 0 for i in range ( s , t ) : now += d [ i ] if now < res - now : print ( now ) else : print ( res - now ) else : now = 0 for i in range ( t , s ) : now += d [ i ] if now < res - now : print ( now ) else : print ( res - now ) NEW_LINE


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

import java . io . * ; import java . util . * ; import java . util . stream . Collectors ; import java . util . stream . Stream ;   import static java . lang . Integer . * ; import static java . lang . Math . * ;   public class CF771B { public static void main ( String args [ ] ) throws Throwable { BufferedReader in = new BufferedReader ( new InputStreamReader ( System . in ) ) ; for ( String ln ; ( ln = in . readLine ( ) ) != null && ! ln . equals ( " " ) ; ) { StringTokenizer st = new StringTokenizer ( ln ) ; int N = parseInt ( st . nextToken ( ) ) , K = parseInt ( st . nextToken ( ) ) ; String [ ] result = new String [ N ] ; st = new StringTokenizer ( in . readLine ( ) ) ; for ( int i = 0 ; i < N - K + 1 ; i ++ ) { if ( st . nextToken ( ) . equals ( " YES " ) ) { for ( int j = i ; j < i + K ; j ++ ) if ( result [ j ] == null ) result [ j ] = getName ( j ) ; } else { if ( result [ i ] == null ) { result [ i ] = getName ( i ) ; result [ i + K - 1 ] = getName ( i ) ; } else result [ i + K - 1 ] = result [ i ] ; } } for ( int i = 0 ; i < N ; i ++ ) if ( result [ i ] == null ) result [ i ] = getName ( i ) ; System . out . println ( Stream . of ( result ) . collect ( Collectors . joining ( " ▁ " ) ) ) ; } }   static String getName ( int p ) { if ( p < 26 ) return ( char ) ( p + ' A ' ) + " " ; return ( char ) ( p / 26 + ' A ' ) + " " + ( char ) ( p % 26 + ' a ' ) ; } }

import java . util . Arrays ; import java . util . Scanner ;   public class Main {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) , k = sc . nextInt ( ) ; boolean [ ] rp = new boolean [ n ] ; String [ ] arr = new String [ n ] ; for ( int i = 0 ; i < n - k + 1 ; ++ i ) { rp [ i ] = sc . next ( ) . equals ( " NO " ) ; } for ( int i = 0 ; i < n ; ++ i ) { if ( arr [ i ] == null ) arr [ i ] = ( i < 25 ? " A " : " B " ) + ( char ) ( ' a ' + i % 25 ) ; if ( rp [ i ] ) { arr [ i + k - 1 ] = arr [ i ] ; } } for ( String s : arr ) System . out . print ( s + " ▁ " ) ; } }

n , k = map ( int , input ( ) . split ( ) ) s = input ( ) . split ( ) ans = [ ] for i in range ( 26 ) : ans . append ( chr ( 65 + i ) + " a " ) for i in range ( 24 ) : ans . append ( chr ( 65 + i ) + " b " ) for i in range ( n - k + 1 ) : if s [ i ] == " NO " : ans [ i + k - 1 ] = ans [ i ] ans = ans [ : n ] print ( * ans ) NEW_LINE

import sys import mathfrom collections import Counterfrom operator import itemgetterimport queue   def IO ( ) : sys . stdin = open ( " pyinput . txt " , ' r ' ) sys . stdout = open ( " pyoutput . txt " , ' w ' )   def GCD ( a , b ) : if ( b == 0 ) : return a else : return GCD ( b , a % b )   def LCM ( a , b ) : return a * ( b // GCD ( a , b ) )   def scan ( TYPE_1 , TYPE_2 = 0 ) : if ( TYPE_1 == int ) : return map ( int , sys . stdin . readline ( ) . strip ( ) . split ( ) ) elif ( TYPE_1 == float ) : return map ( float , sys . stdin . readline ( ) . strip ( ) . split ( ) ) elif ( TYPE_1 == list and TYPE_2 == float ) : return list ( map ( float , sys . stdin . readline ( ) . strip ( ) . split ( ) ) ) elif ( TYPE_1 == list and TYPE_2 == int ) : return list ( map ( int , sys . stdin . readline ( ) . strip ( ) . split ( ) ) ) elif ( TYPE_1 == str ) : return sys . stdin . readline ( ) . strip ( ) else : print ( " ERROR ! ! ! ! " )         def main ( ) : s = [ ] for i in range ( 65 , 91 ) : s . append ( chr ( i ) ) for i in range ( 97 , 123 ) : s . append ( ' A ' + chr ( i ) )   n , k = scan ( int ) a = scan ( str ) . split ( ) ans = [ ] idx = 0   for i in range ( k - 1 ) : ans . append ( s [ idx ] ) idx += 1   for i in range ( n - k + 1 ) : if ( a [ i ] == ' NO ' ) : ans . append ( ans [ - k + 1 ] ) else : ans . append ( s [ idx ] ) idx += 1   print ( * ans )       NEW_LINE

''' input8 ▁ 3NO ▁ NO ▁ YES ▁ YES ▁ YES ▁ NO ''' n , k = map ( int , input ( ) . split ( ) ) s = input ( ) . split ( ) names = [ chr ( ord ( ' A ' ) + ( i // 26 ) ) + chr ( ord ( ' a ' ) + ( i % 26 ) ) for i in range ( 1 , n + 1 ) ] for i in range ( len ( s ) ) : if ( s [ i ] == ' NO ' ) : names [ i + k - 1 ] = names [ i ] for name in names : print ( name , end = ' ▁ ' ) NEW_LINE


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

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

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

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

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . HashSet ; import java . util . StringTokenizer ;   public class A_Boy_or_Girl { public static void main ( String [ ] args ) { FastScanner fs = new FastScanner ( ) ; char [ ] s = fs . next ( ) . toCharArray ( ) ; HashSet < Character > dist = new HashSet < > ( ) ;   for ( char c : s ) { dist . add ( c ) ; }   if ( dist . size ( ) % 2 == 0 ) { System . out . println ( " CHAT ▁ WITH ▁ HER ! " ) ; } else { System . out . println ( " IGNORE ▁ HIM ! " ) ; } }   static int min ( int a , int b ) { return Math . min ( a , b ) ; }   static int max ( int a , int b ) { return Math . max ( a , b ) ; }   static long min ( long a , long b ) { return Math . min ( a , b ) ; }   static long max ( long a , long b ) { return Math . max ( a , b ) ; }   static class FastScanner { BufferedReader br ; StringTokenizer st ;   public FastScanner ( ) { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; }   String next ( ) { while ( st == null || ! st . hasMoreElements ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; }   int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; } char nextChar ( ) { return next ( ) . charAt ( 0 ) ; }   String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; } } }

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

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

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


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

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

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

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

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

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

t = int ( input ( ) ) for i in range ( t ) : a = int ( input ( ) ) b = format ( a , ' b ' ) NEW_LINE


import java . util . Scanner ;   public class Main {   static String [ ] str = new String [ 3 ] ; static boolean flag ; public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; for ( int i = 0 ; i < 3 ; i ++ ) { str [ i ] = in . next ( ) ; } fun ( str [ 0 ] , str [ 1 ] , str [ 2 ] , " F " ) ; fun ( str [ 1 ] , str [ 0 ] , str [ 2 ] , " M " ) ; fun ( str [ 2 ] , str [ 1 ] , str [ 0 ] , " S " ) ; if ( flag == false ) { System . out . println ( " ? " ) ; }   in . close ( ) ; }   private static void fun ( String a , String b , String c , String res ) { if ( a . equals ( " rock " ) ) { if ( b . equals ( " scissors " ) && c . equals ( " scissors " ) ) { System . out . println ( res ) ; flag = true ; } } if ( a . equals ( " paper " ) ) { if ( b . equals ( " rock " ) && c . equals ( " rock " ) ) { System . out . println ( res ) ; flag = true ; } } if ( a . equals ( " scissors " ) ) { if ( b . equals ( " paper " ) && c . equals ( " paper " ) ) { System . out . println ( res ) ; flag = true ; } } } }

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

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

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

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

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

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

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

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

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


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

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

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

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

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


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

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

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

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

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

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


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

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

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

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

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

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

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


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

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

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

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

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

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

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


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

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

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

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

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

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

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


import java . util . * ;   public class StackBracket { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; for ( int i = 0 ; i < t ; i ++ ) { int n = sc . nextInt ( ) ; int [ ] ar = new int [ n ] ; for ( int j = 0 ; j < n ; j ++ ) { ar [ j ] = sc . nextInt ( ) ; } int [ ] minar = new int [ n ] ;

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

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

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

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

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

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

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

import sys , math , itertoolsfrom collections import Counter , deque , defaultdictfrom bisect import bisect_left , bisect_right from heapq import heappop , heappush , heapifyfrom copy import deepcopymod = 10 ** 9 + 7 INF = float ( ' inf ' ) def inp ( ) : return int ( sys . stdin . readline ( ) ) def inpl ( ) : return list ( map ( int , sys . stdin . readline ( ) . split ( ) ) ) def inpl_1 ( ) : return list ( map ( lambda x : int ( x ) - 1 , sys . stdin . readline ( ) . split ( ) ) ) def inps ( ) : return sys . stdin . readline ( ) def inpsl ( x ) : tmp = sys . stdin . readline ( ) ; return list ( tmp [ : x ] ) def err ( x ) : print ( x ) ; exit ( )   for _ in range ( inp ( ) ) : n = inp ( ) a = inpl ( ) res = 0 mi = INF for i in range ( n ) [ : : - 1 ] : mi = min ( mi , a [ i ] ) if i == 0 : break if a [ i - 1 ] > mi : res += 1 print ( res ) NEW_LINE


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

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

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

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

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


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

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

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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


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

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

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

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

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

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

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