import java . util . * ;   public class Array_493 { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ; String first = scanner . next ( ) ; String second = scanner . next ( ) ;   String ans = solution ( first , second ) ;   System . out . println ( ans ) ; }   private static String solution ( String first , String second ) { char [ ] fArr = first . toCharArray ( ) ; char [ ] sArr = second . toCharArray ( ) ;   int i = fArr . length - 1 ; while ( i >= 0 ) { if ( fArr [ i ] == ' z ' ) { fArr [ i ] = ' a ' ; } else { fArr [ i ] ++ ; break ; } i -- ; }   return test ( String . valueOf ( fArr ) , String . valueOf ( sArr ) ) ? String . valueOf ( fArr ) : " No ▁ such ▁ string " ; }   public static boolean test ( String first , String second ) { return first . compareTo ( second ) < 0 ; } }

import java . io . * ; import java . util . * ; import java . math . * ;   public class A293 { static char [ ] sarr ; public static void main ( String [ ] args ) throws IOException { FastScanner fs = new FastScanner ( ) ; PrintWriter out = new PrintWriter ( System . out ) ;

import java . io . * ; import java . math . * ; import java . util . * ; import java . text . * ;   public class Main { public static void main ( String [ ] args ) { Scanner cin = new Scanner ( new BufferedInputStream ( System . in ) ) ; String a = cin . nextLine ( ) ; String b = cin . nextLine ( ) ; HashMap < Character , BigInteger > mp = new HashMap < > ( ) ; HashMap < BigInteger , Character > rmp = new HashMap < > ( ) ; String dic = new String ( " abcdefghijklmnopqrstuvwxyz " ) ; for ( int i = 0 ; i < 26 ; ++ i ) { mp . put ( dic . charAt ( i ) , BigInteger . valueOf ( i ) ) ; rmp . put ( BigInteger . valueOf ( i ) , dic . charAt ( i ) ) ; } BigInteger L = BigInteger . ONE ; BigInteger R = BigInteger . ONE ; for ( int i = 0 ; i < a . length ( ) ; ++ i ) { L = L . multiply ( BigInteger . valueOf ( 26 ) ) . add ( mp . get ( a . charAt ( i ) ) ) ; R = R . multiply ( BigInteger . valueOf ( 26 ) ) . add ( mp . get ( b . charAt ( i ) ) ) ; } if ( R . subtract ( L ) . equals ( BigInteger . ONE ) ) { System . out . println ( " No ▁ such ▁ string " ) ; } else { L = L . add ( BigInteger . ONE ) ; String ans = new String ( " " ) ; while ( ! L . equals ( BigInteger . ONE ) ) { ans += rmp . get ( L . mod ( BigInteger . valueOf ( 26 ) ) ) ; L = L . divide ( BigInteger . valueOf ( 26 ) ) ; } System . out . println ( new StringBuffer ( ans ) . reverse ( ) . toString ( ) ) ; } } }

from collections import defaultdict , deque , Counterfrom sys import stdin , stdoutfrom heapq import heappush , heappopimport mathimport ioimport osimport mathimport bisect   NEW_LINE

s = input ( ) t = input ( ) n = len ( s ) ans = " " f = 0 d = 0 i = 0 while ( i < n ) : val1 = 1 if ( s [ i ] == t [ i ] ) : ans += s [ i ] else : if ( f == 0 ) : f = 1 if ord ( t [ i ] ) - ord ( s [ i ] ) > 1 : val = ord ( s [ i ] ) val += 1 d = 1 ans += chr ( val ) else : val1 = 1 ans += s [ i ] for j in range ( i + 1 , n ) : if ( s [ j ] != ' z ' ) : d = 1 val = ord ( s [ j ] ) val += 1 ans += chr ( val ) val1 += 1 break else : ans += t [ j ] val1 += 1 if ( d == 0 ) : ans = ans [ : i ] val1 = 1 ans += t [ i ] for j in range ( i + 1 , n ) : if ( t [ j ] != ' a ' ) : d = 1 ans += ' a ' val1 += 1 break else : ans += t [ j ] val1 += 1 else : ans += s [ i ] i += val1if ( d == 0 ) : print ( " No ▁ such ▁ string " ) else : print ( ans ) NEW_LINE

s = input ( ) t = input ( ) flag = Trueans = list ( s ) i = len ( s ) - 1 while True : if ord ( s [ i ] ) != ord ( ' z ' ) : ans [ i ] = chr ( ord ( ans [ i ] ) + 1 ) break else : ans [ i ] = ' a ' i -= 1 t = list ( t ) if ans != t : for i in range ( len ( ans ) ) : print ( ans [ i ] , end = " " ) else : print ( ' No ▁ such ▁ string ' ) NEW_LINE

a = list ( input ( ) ) b = input ( ) i = len ( a ) - 1 while a [ i ] == ' z ' : a [ i ] = ' a ' i -= 1 a [ i ] = chr ( ord ( a [ i ] ) + 1 ) a = ' ' . join ( a ) if a >= b : print ( ' No ▁ such ▁ string ' ) else : print ( a ) NEW_LINE

import sys , os , iofrom sys import stdinfrom math import log , gcd , ceilfrom collections import defaultdict , deque , Counterfrom heapq import heappush , heappop , heapifyfrom bisect import bisect_left , bisect_rightimport math def ii ( ) : return int ( input ( ) ) def li ( ) : return list ( map ( int , input ( ) . split ( ) ) ) if ( os . path . exists ( ' input . txt ' ) ) : sys . stdin = open ( " input . txt " , " r " ) ; sys . stdout = open ( " output . txt " , " w " ) NEW_LINE


import java . util . * ;   public class P1 { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int a [ ] = new int [ n - 1 ] ; for ( int i = 0 ; i < n - 1 ; i ++ ) { a [ i ] = sc . nextInt ( ) ; } ArrayList < Integer > al = new ArrayList < > ( ) ; int c = n ; al . add ( c ) ; while ( c > 1 ) { c = a [ c - 2 ] ; al . add ( c ) ; } Collections . reverse ( al ) ; for ( int i = 0 ; i < al . size ( ) ; i ++ ) { System . out . print ( al . get ( i ) + " ▁ " ) ; } } }

import java . util . * ; import java . util . jar . JarOutputStream ;   public class Practise {   public static int [ ] [ ] dp ;   public static void main ( String [ ] args ) {

import java . util . * ; public class Check2 { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int ar [ ] = new int [ n + 2 ] ; for ( int i = 2 ; i < ( n + 1 ) ; i ++ ) { ar [ i ] = sc . nextInt ( ) ; } List < Integer > list = new ArrayList < > ( ) ; int k = n ; while ( k >= 1 ) {

import java . util . * ;   public class questionCF { public static void main ( String [ ] args ) {   Scanner sc = new Scanner ( System . in ) ;   int n = sc . nextInt ( ) ;   int a [ ] = new int [ n ] ; ArrayList < Integer > l = new ArrayList < > ( ) ; for ( int i = 0 ; i < n - 1 ; i ++ ) a [ i ] = sc . nextInt ( ) ; int i = n ; l . add ( i ) ; while ( i > 1 ) { i = a [ i - 2 ] ; l . add ( i ) ; } for ( i = l . size ( ) - 1 ; i >= 0 ; i -- ) System . out . print ( l . get ( i ) + " ▁ " ) ; } }

n = int ( input ( ) ) a = [ 0 ] + [ 0 ] + [ int ( x ) for x in input ( ) . strip ( ) . split ( ) ]   b = [ ]   while a [ n ] >= 1 : b . append ( n ) n = a [ n ]     b . append ( 1 ) b . reverse ( ) b_new = ( str ( x ) for x in b ) print ( " ▁ " . join ( b_new ) ) NEW_LINE

n = int ( input ( ) ) p = [ 0 ] * 2 + list ( map ( int , input ( ) . split ( ) ) )   c = npath = [ n ] while c != 1 : c = p [ c ] path . append ( c ) print ( * path [ : : - 1 ] ) NEW_LINE

n = int ( input ( ) )   p = list ( map ( int , input ( ) . split ( ) ) )   pa = n   ans = [ ]   while True : ans . append ( pa ) if pa == 1 : break pa = p [ pa - 2 ] print ( * ans [ : : - 1 ] ) NEW_LINE

n = int ( input ( ) ) p = [ 0 , 0 , * map ( int , input ( ) . split ( ) ) ] r = [ ] while n : r . append ( n ) ; n = p [ n ] print ( * reversed ( r ) ) NEW_LINE


import java . io . * ; import java . util . * ; import java . text . * ; import java . math . * ; import java . util . regex . * ; public class RockB { Scanner in = new Scanner ( System . in ) ;   private RockB ( ) throws IOException {

import java . io . InputStream ; import java . io . InputStreamReader ; import java . io . BufferedReader ; import java . io . OutputStream ; import java . io . PrintWriter ; import java . io . IOException ;   public class Main { public static void main ( String [ ] args ) { InputStream inputStream = System . in ; OutputStream outputStream = System . out ; InputReader in = new InputReader ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; TaskB solver = new TaskB ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; } }   class TaskB { public void solve ( int testNumber , InputReader in , PrintWriter out ) { String word = in . next ( ) ; int answer = 0 ;   for ( int i = 0 ; i < word . length ( ) ; i ++ ) { answer = Math . max ( answer , getAns ( word , i ) ) ; }   out . println ( answer ) ;   }   private int getAns ( String word , int start ) { char ch = word . charAt ( start ) ; int res = 1 ; while ( start < word . length ( ) ) { int nextIdx = start + 1 ; while ( nextIdx < word . length ( ) ) { if ( word . charAt ( nextIdx ) == ch && ( ( nextIdx - start ) % 2 == 1 ) ) { break ; } nextIdx ++ ; }   if ( nextIdx < word . length ( ) ) { res ++ ; } start = nextIdx ; }   return res ; }   }   class InputReader { private BufferedReader reader ; private String [ ] currentArray ;   public InputReader ( InputStream inputStream ) { reader = new BufferedReader ( new InputStreamReader ( inputStream ) ) ; }    public String next ( ) { try { currentArray = null ; return reader . readLine ( ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } }   }

import java . util . Scanner ;   public class MAIN {   public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; String s = in . nextLine ( ) ; in . close ( ) ; int res = 0 ; if ( s != null && s . length ( ) > 0 ) {

t = { } for i , c in enumerate ( input ( ) ) : if c not in t : t [ c ] = ( i , 1 ) elif ( t [ c ] [ 0 ] - i ) & 1 : t [ c ] = ( i , t [ c ] [ 1 ] + 1 ) print ( max ( b for a , b in t . values ( ) ) )         NEW_LINE


import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . math . BigInteger ; import java . util . StringTokenizer ;   public class V {   static class FastReader { BufferedReader bf ; StringTokenizer st ;   public FastReader ( ) { bf = new BufferedReader ( new InputStreamReader ( System . in ) ) ; } String next ( ) { while ( st == null || ! st . hasMoreElements ( ) ) try { st = new StringTokenizer ( bf . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return st . nextToken ( ) ; } int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; } String nextLine ( ) throws IOException { return bf . readLine ( ) ; } boolean ready ( ) throws IOException { return bf . ready ( ) || ( st != null && st . hasMoreElements ( ) ) ; } }   public static void main ( String [ ] args ) { FastReader fr = new FastReader ( ) ; int n = fr . nextInt ( ) - 1 ; if ( n < 0 ) System . out . println ( 1 ) ; else { BigInteger result = new BigInteger ( "3" ) ; BigInteger mod = new BigInteger ( "1000003" ) ; BigInteger exp = new BigInteger ( Integer . toString ( n ) ) ; result = result . modPow ( exp , mod ) ; System . out . println ( result . toString ( ) ) ; } } }

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

n = int ( input ( ) ) NEW_LINE if ( n == 0 ) : NEW_LINE INDENT print ( "1" ) else : NEW_LINE ans = int ( 3 ** ( n - 1 ) ) NEW_LINE DEDENT ans = ans % ( 1000003 ) NEW_LINE print ( ans ) NEW_LINE

print ( pow ( 3 , max ( 0 , int ( input ( ) ) - 1 ) , int ( 1e6 + 3 ) ) ) NEW_LINE

n = int ( input ( ) ) - 1 NEW_LINE if ( n < 0 ) : NEW_LINE INDENT print ( 1 ) else : NEW_LINE print ( pow ( 3 , n , 1000003 ) ) NEW_LINE DEDENT

n = int ( input ( ) ) NEW_LINE print ( ( 3 ** ( n - 1 ) ) % ( 10 ** 6 + 3 ) if n > 0 else 1 ) NEW_LINE


import java . util . Scanner ;   public class A1447 {   public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int T = in . nextInt ( ) ; StringBuilder output = new StringBuilder ( ) ; for ( int t = 0 ; t < T ; t ++ ) { int N = in . nextInt ( ) ; output . append ( N ) . append ( ' \n ' ) ; for ( int n = 1 ; n <= N ; n ++ ) { output . append ( n ) . append ( ' ▁ ' ) ; } output . append ( ' \n ' ) ; } System . out . print ( output ) ; }   }

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

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . math . BigInteger ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . Scanner ; import java . util . StringTokenizer ; import java . util . stream . IntStream ;   public class FairchildTangerine {   static class FastReader { BufferedReader br ; StringTokenizer st ;   public FastReader ( ) { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; }   String next ( ) { while ( st == null || ! st . hasMoreElements ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; }   int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; }   long nextLong ( ) { return Long . parseLong ( next ( ) ) ; }   double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; }   String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; } }   public static void main ( String [ ] args ) { try {   FastReader s = new FastReader ( ) ; int T = s . nextInt ( ) ;   while ( T > 0 ) {   int N = s . nextInt ( ) ; System . out . println ( N ) ;   for ( int i = 1 ; i <= N ; i ++ ) { System . out . print ( i + " ▁ " ) ; } System . out . println ( ) ; T -- ; } } catch (   Exception e ) { return ;   } } }

import java . io . BufferedReader ; import java . io . Closeable ; import java . io . IOException ; import java . io . InputStream ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . StringTokenizer ;   public class AddCandies implements Closeable {   private InputReader in = new InputReader ( System . in ) ; private PrintWriter out = new PrintWriter ( System . out ) ;   public void solve ( ) { int t = in . ni ( ) ; while ( t -- > 0 ) { int n = in . ni ( ) ; out . println ( n - 1 ) ; for ( int i = 2 ; i <= n ; i ++ ) { out . print ( i ) ; out . print ( ' ▁ ' ) ; } out . println ( ) ; } }   @ Override public void close ( ) throws IOException { in . close ( ) ; out . close ( ) ; }   static class InputReader { public BufferedReader reader ; public StringTokenizer tokenizer ;   public InputReader ( InputStream stream ) { reader = new BufferedReader ( new InputStreamReader ( stream ) , 32768 ) ; tokenizer = null ; }   public String next ( ) { while ( tokenizer == null || ! tokenizer . hasMoreTokens ( ) ) { try { tokenizer = new StringTokenizer ( reader . readLine ( ) ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } } return tokenizer . nextToken ( ) ; }   public int ni ( ) { return Integer . parseInt ( next ( ) ) ; }   public long nl ( ) { return Long . parseLong ( next ( ) ) ; }   public void close ( ) throws IOException { reader . close ( ) ; } }   public static void main ( String [ ] args ) throws IOException { try ( AddCandies instance = new AddCandies ( ) ) { instance . solve ( ) ; } } }

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

n = int ( input ( ) ) NEW_LINE for i in range ( n ) : m = int ( input ( ) ) NEW_LINE print ( m ) NEW_LINE print ( * [ k for k in range ( 1 , m + 1 ) ] ) NEW_LINE

import sys   input = sys . stdin . buffer . readline   t = int ( input ( ) ) NEW_LINE for _ in range ( t ) : n = int ( input ( ) ) NEW_LINE print ( n ) NEW_LINE print ( " ▁ " . join ( map ( str , range ( 1 , n + 1 ) ) ) ) NEW_LINE

for _ in range ( int ( input ( ) ) ) : n = int ( input ( ) ) NEW_LINE print ( n ) NEW_LINE for i in range ( 1 , n + 1 ) : print ( i , end = " ▁ " ) NEW_LINE print ( )   NEW_LINE

m = int ( input ( ) ) NEW_LINE n = [ ] NEW_LINE for i in range ( m ) : n . append ( int ( input ( ) ) ) NEW_LINE for i in n : print ( i - 1 ) NEW_LINE for j in range ( 2 , i + 1 ) : print ( j , end = ' ▁ ' ) NEW_LINE print ( ) NEW_LINE

import sys   NEW_LINE def main ( ) : _ , * l = map ( int , sys . stdin . read ( ) . strip ( ) . split ( ) ) NEW_LINE out = [ ] NEW_LINE for i in l : out . extend ( ( str ( i - 1 ) , ' ▁ ' . join ( map ( str , range ( 2 , i + 1 ) ) ) ) ) NEW_LINE return out NEW_LINE print ( * main ( ) , sep = ' \n ' ) NEW_LINE


# include < bits / stdc ++ . h > using namespace std ; void uttam ( ) { string s , t ; cin >> s >> t ; int n = s . length ( ) ; for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < n ; j ++ ) { if ( s [ i ] == t [ j ] ) { cout << " YES " << endl ; return ; } } } cout << " NO " << endl ; } int main ( ) { int t ; cin >> t ; for ( int i = 0 ; i < t ; i ++ ) uttam ( ) ; }

import java . util . * ;   public class CF102 { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int q = sc . nextInt ( ) ; for ( int i = 0 ; i < q ; i ++ ) { String s = sc . next ( ) ; String t = sc . next ( ) ; boolean ans = false ; for ( int j = 0 ; j < s . length ( ) ; j ++ ) { char ch = s . charAt ( j ) ;

import java . util . Scanner ;   public class _0690StringsEqualization {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int cases = sc . nextInt ( ) ; sc . nextLine ( ) ; while ( cases > 0 ) { String s = sc . nextLine ( ) ; String t = sc . nextLine ( ) ; boolean flag = false ; a : { for ( int i = 0 ; i < s . length ( ) ; i ++ ) { for ( int j = 0 ; j < t . length ( ) ; j ++ ) { if ( s . charAt ( i ) == t . charAt ( j ) ) { flag = true ; break a ; } } } } if ( flag ) { System . out . println ( " YES " ) ; } else { System . out . println ( " NO " ) ; } cases -- ; } }   }

if __name__ == " _ _ main _ _ " : for _ in range ( int ( input ( ) ) ) : s = input ( ) t = input ( ) li = list ( s ) for i in li : if i in t : print ( " YES " ) break else : print ( " NO " ) NEW_LINE

def solve ( ) : s , t = input ( ) , input ( ) if len ( set ( s ) & set ( t ) ) > 0 : print ( ' YES ' ) else : print ( ' NO ' )   t = int ( input ( ) ) for _ in range ( t ) : solve ( ) NEW_LINE

try : q = int ( input ( ) ) for i in range ( q ) : s = input ( ) t = input ( ) v = True for j in s : if t . __contains__ ( j ) : print ( " YES " ) v = False break if v : print ( " NO " ) except : pass NEW_LINE

from __future__ import division , print_functionfrom collections import * from math import * from itertools import * import osimport sysfrom io import BytesIO , IOBase NEW_LINE

from __future__ import division , print_functionfrom collections import * from math import * from itertools import * from time import timeimport osimport sysfrom io import BytesIO , IOBase   if sys . version_info [ 0 ] < 3 : from __builtin__ import xrange as range from future_builtins import ascii , filter , hex , map , oct , zip   ''' Notes : n ▁ = ▁ number ▁ of ▁ ballsk ▁ = ▁ attract ▁ powerni ▁ = ▁ ball ' s ▁ coords '''   def main ( ) : s = list ( input ( ) ) t = list ( input ( ) ) if ( ' ' . join ( s ) ) == ( ' ' . join ( t ) ) : print ( ' YES ' ) return ss = set ( s ) st = set ( t ) for i in ss : if i in st : print ( ' YES ' ) return print ( ' NO ' ) return         NEW_LINE


import java . util . Scanner ;   public class FrameArtist { public static void main ( String [ ] args ) { Scanner scanner = new Scanner ( System . in ) ;   int n = scanner . nextInt ( ) ; int [ ] a = new int [ 101 ] ; int count = 0 ;   for ( int i = 0 ; i < n ; i ++ ) { int add = scanner . nextInt ( ) ; a [ add ] ++ ;   if ( a [ add ] == 4 ) { count ++ ; a [ add ] = 0 ; } }   for ( int i = 1 ; i < 101 ; i ++ ) { if ( a [ i ] > 1 ) { for ( int j = i + 1 ; j < 101 ; j ++ ) { if ( a [ j ] > 1 ) { count ++ ; a [ j ] = 0 ; break ; } } } }   System . out . println ( count ) ; } }

n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) d = [ 0 ] * ( max ( a ) + 1 ) pas = 0 x = 0 for k in range ( n ) : d [ a [ k ] ] += 1 for k in range ( len ( d ) ) : pas += d [ k ] // 4   if d [ k ] % 4 > 1 : if x == 1 : pas += 1 x = 0 else : x = 1 print ( pas ) NEW_LINE

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

n = ( int ) ( input ( ) ) d = { } a = list ( map ( int , input ( ) . split ( ) ) ) for i in a : if i in d : d [ i ] += 1 else : d [ i ] = 1 res = 0 for i in d : res += ( int ) ( d [ i ] / 2 ) print ( ( int ) ( res / 2 ) ) NEW_LINE

n = int ( input ( ) ) l = list ( input ( ) . split ( ) ) d = { } for gar in l : if gar in d : d [ gar ] = d [ gar ] + 1 else : d [ gar ] = 1 pari = 0 for gar in d : pari = pari + d [ gar ] // 2 print ( pari // 2 ) NEW_LINE


import java . io . BufferedReader ; import java . io . BufferedWriter ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . OutputStreamWriter ;    public class Q { public static void main ( String [ ] args ) throws IOException { BufferedReader reader = new BufferedReader ( new InputStreamReader ( System . in ) ) ; BufferedWriter writer = new BufferedWriter ( new OutputStreamWriter ( System . out ) ) ; int num = Integer . parseInt ( reader . readLine ( ) ) ; String word = reader . readLine ( ) ; boolean Char [ ] = new boolean [ 70 ] ; Char [ ' a ' - ' a ' ] = true ; Char [ ' o ' - ' a ' ] = true ; Char [ ' i ' - ' a ' ] = true ; Char [ ' u ' - ' a ' ] = true ; Char [ ' y ' - ' a ' ] = true ; Char [ ' e ' - ' a ' ] = true ; int count = 0 ; boolean x = true ; for ( int i = 0 ; i < num ; i ++ ) { char ltr = word . charAt ( i ) ; if ( Char [ ltr - ' a ' ] ) { count ++ ; } else { count = 0 ; } if ( count <= 1 ) { writer . write ( " " + ltr ) ; }   } writer . newLine ( ) ; writer . flush ( ) ; } }

import java . io . BufferedReader ; import java . io . BufferedWriter ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . OutputStreamWriter ;    public class Q { public static void main ( String [ ] args ) throws IOException { BufferedReader reader = new BufferedReader ( new InputStreamReader ( System . in ) ) ; BufferedWriter writer = new BufferedWriter ( new OutputStreamWriter ( System . out ) ) ; int num = Integer . parseInt ( reader . readLine ( ) ) ; String word = reader . readLine ( ) ; String word2 = " " ; for ( int i = 0 ; i < num ; i ++ ) { char ltr = word . charAt ( i ) ; if ( i != 0 ) { if ( ( ltr == ' a ' || ltr == ' e ' || ltr == ' o ' || ltr == ' u ' || ltr == ' i ' || ltr == ' y ' ) && ( word . charAt ( i - 1 ) == ' y ' || word . charAt ( i - 1 ) == ' a ' || word . charAt ( i - 1 ) == ' o ' || word . charAt ( i - 1 ) == ' i ' || word . charAt ( i - 1 ) == ' e ' || word . charAt ( i - 1 ) == ' u ' ) && i != 0 ) {   } else { word2 += ltr ; } } else { word2 += ltr ; }   } writer . write ( word2 ) ; writer . newLine ( ) ; writer . flush ( ) ; } }

import java . io . BufferedReader ; import java . io . BufferedWriter ; import java . io . InputStreamReader ; import java . io . OutputStreamWriter ;   public class Main {   public static void main ( String [ ] args ) throws Exception { BufferedReader reader = new BufferedReader ( new InputStreamReader ( System . in ) ) ; BufferedWriter writer = new BufferedWriter ( new OutputStreamWriter ( System . out ) ) ; int n = Integer . parseInt ( reader . readLine ( ) ) ; String v = " aouiey " ; String word = reader . readLine ( ) ; int count = 0 ; for ( int i = 0 ; i < word . length ( ) ; i ++ ) {   if ( v . contains ( " " + word . charAt ( i ) ) ) { count ++ ;

import java . io . * ; import java . util . * ; import java . text . * ; import java . math . * ; import java . util . regex . * ; public class Main { public static void main ( String [ ] args ) { Scanner s = new Scanner ( System . in ) ; int n = s . nextInt ( ) ; String str = s . next ( ) ; char [ ] ch = str . toCharArray ( ) ; System . out . print ( ch [ 0 ] ) ; for ( int i = 1 ; i < ch . length ; i ++ ) if ( check ( ch [ i ] ) == 0 ) System . out . print ( ch [ i ] ) ; else { if ( check ( ch [ i - 1 ] ) == 0 ) System . out . print ( ch [ i ] ) ; } } public static int check ( char x ) { if ( x == ' a ' || x == ' e ' || x == ' i ' || x == ' o ' || x == ' u ' || x == ' y ' ) return 1 ; return 0 ; } }

import java . util . Scanner ; public class NewClass6 { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int n = in . nextInt ( ) ; String x = in . next ( ) ; int j ; String y = " aeiouy " , z = " " ; for ( int i = 0 ; i < n ; i ++ ) { z += x . charAt ( i ) + " " ; if ( y . contains ( x . charAt ( i ) + " " ) ) { for ( j = i + 1 ; j < n ; j ++ ) { if ( ! ( y . contains ( x . charAt ( j ) + " " ) ) ) { break ; } } i = j - 1 ; } } System . out . println ( z ) ; } }

import reinput ( ) print ( re . sub ( ' ( [ aeiouy ] ) [ aeiouy ] + ' , ' \\1' , input ( ) ) ) NEW_LINE

import sys , math , itertoolsfrom collections import Counter , deque , defaultdictfrom bisect import bisect_left , bisect_right from heapq import heappop , heappush , heapify , nlargestfrom copy import deepcopymod = 10 ** 9 + 7 INF = float ( ' inf ' ) def inp ( ) : return int ( sys . stdin . readline ( ) ) def inpl ( ) : return list ( map ( int , sys . stdin . readline ( ) . split ( ) ) ) def inpl_1 ( ) : return list ( map ( lambda x : int ( x ) - 1 , sys . stdin . readline ( ) . split ( ) ) ) def inps ( ) : return sys . stdin . readline ( ) def inpsl ( x ) : tmp = sys . stdin . readline ( ) ; return list ( tmp [ : x ] ) def err ( x ) : print ( x ) ; exit ( )   n = inp ( ) s = input ( ) res = [ ] boin = [ ' a ' , ' i ' , ' u ' , ' e ' , ' o ' , ' y ' ] for i in range ( n ) : if res and res [ - 1 ] in boin and s [ i ] in boin : continue res . append ( s [ i ] ) print ( ' ' . join ( res ) ) NEW_LINE

size = int ( input ( ) ) word = list ( input ( ) )   def isConsecutiveVowels ( ch1 , ch2 ) : return ( ch1 in " aeiouy " ) and ( ch2 in " aeiouy " )   for i in range ( 1 , size ) : if isConsecutiveVowels ( word [ i ] , word [ i - 1 ] ) : word [ i ] = ' '           print ( ' ' . join ( word ) ) NEW_LINE

n = int ( input ( ) ) s = input ( ) l = [ ] l . append ( s [ 0 ] ) for i in range ( 1 , len ( s ) ) : if ( ( l [ len ( l ) - 1 ] == " a " or l [ len ( l ) - 1 ] == " e " or l [ len ( l ) - 1 ] == " i " or l [ len ( l ) - 1 ] == " o " or l [ len ( l ) - 1 ] == " u " or l [ len ( l ) - 1 ] == " y " ) and ( s [ i ] == " a " or s [ i ] == " e " or s [ i ] == " i " or s [ i ] == " o " or s [ i ] == " u " or s [ i ] == " y " ) ) : pass else : l . append ( s [ i ] ) for i in range ( len ( l ) ) : print ( l [ i ] , end = " " ) NEW_LINE


import java . util . Scanner ; import java . util . * ;   public class Solution {   public static void main ( String [ ] args ) { boolean debug = false ;   Scanner input = new Scanner ( System . in ) ;   String s = input . next ( ) ;   int count = 0 ;   int currentCount = 1 ; for ( int i = 1 ; i < s . length ( ) ; i ++ ) { if ( s . charAt ( i ) == s . charAt ( i - 1 ) ) { currentCount ++ ; if ( i == s . length ( ) - 1 ) { if ( currentCount % 2 == 0 ) count ++ ; } } else { if ( currentCount % 2 == 0 ) count ++ ; currentCount = 1 ; } }   System . out . println ( count ) ; }    }

import java . util . Scanner ; public class Pro { public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; String s ; int n , i , c = 1 , f = 0 ; char ch1 , ch2 ; s = sc . nextLine ( ) ; s = s + " ▁ " ; n = s . length ( ) ; ch1 = s . charAt ( 0 ) ; for ( i = 0 ; i < n - 1 ; i ++ ) { if ( c == 1 ) ch1 = s . charAt ( i ) ; ch2 = s . charAt ( i + 1 ) ; if ( ch1 == ch2 ) c ++ ; else { if ( c % 2 == 0 ) f ++ ; c = 1 ; } } System . out . println ( f ) ; } }

import sysstring = str ( sys . stdin . readline ( ) ) string = list ( string ) def solution ( string ) : count = 1 answer = 0 num = 0 NEW_LINE

s = input ( ) num = 0 i = 0 while ( i < len ( s ) ) : for j in range ( i + 1 , len ( s ) + 1 ) : if ( j == len ( s ) or s [ i ] != s [ j ] ) : if ( ( j - i ) % 2 == 0 ) : num += 1 i = j - 1 break i += 1 print ( num ) NEW_LINE

strand = input ( ) add = 0 count = 1 for i in range ( len ( strand ) - 1 ) : if strand [ i ] == strand [ i + 1 ] : count += 1 elif strand [ i ] != strand [ i + 1 ] : if count % 2 == 0 : add += 1 count = 1   if i == len ( strand ) - 2 : if count % 2 == 0 : add += 1   print ( add ) NEW_LINE

import math     def split ( word ) : return [ char for char in word ]   fin = input ( )   gene = split ( fin ) n = len ( gene ) max = [ ] counter = 1     for i in range ( 1 , n ) : if gene [ i ] == gene [ i - 1 ] : counter += 1 else : max . append ( counter ) counter = 1 max . append ( counter )     answer = 0 for i in range ( 0 , len ( max ) ) : if max [ i ] % 2 == 0 : answer += 1 else : answer += 0     print ( answer ) NEW_LINE

arr = input ( )     count = 0 insertion = 0 for i in range ( 1 , len ( arr ) ) : if arr [ i ] == arr [ i - 1 ] : count += 1 else : if ( count + 1 ) % 2 == 0 : insertion += 1 count = 0 if ( count + 1 ) % 2 == 0 : insertion += 1 print ( insertion ) NEW_LINE


import java . util . * ; public class P2 {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int a [ ] = new int [ n ] ; Map < Integer , Integer > map = new HashMap < > ( ) ; int c = 0 ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = sc . nextInt ( ) ; if ( ! map . containsKey ( a [ i ] ) ) { map . put ( a [ i ] , 1 ) ; } else { if ( a [ i ] != 0 ) { c ++ ; } int value = map . get ( a [ i ] ) ; value ++ ; map . replace ( a [ i ] , value ) ; } } int max = 0 ; for ( int k : map . keySet ( ) ) { if ( max < map . get ( k ) ) { if ( k != 0 ) max = map . get ( k ) ; } }

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . List ; import java . util . stream . Collectors ; import java . util . stream . Stream ;   public class Polygamy {   public static void main ( String [ ] args ) throws IOException { BufferedReader reader = new BufferedReader ( new InputStreamReader ( System . in ) ) ; reader . readLine ( ) ; List < Integer > counts = Stream . of ( reader . readLine ( ) . trim ( ) . split ( " ▁ " ) ) . map ( Integer :: parseInt ) . sorted ( ) . collect ( Collectors . toList ( ) ) ; if ( counts . size ( ) == 1 ) { System . out . println ( "0" ) ; return ; } int result = 0 ; for ( int i = 0 ; i < counts . size ( ) - 2 ; i ++ ) { if ( counts . get ( i ) == 0 ) continue ; if ( counts . get ( i ) . equals ( counts . get ( i + 1 ) ) ) { if ( counts . get ( i ) . equals ( counts . get ( i + 2 ) ) ) { System . out . println ( " - 1" ) ; return ; } ++ i ; ++ result ; } } if ( counts . get ( counts . size ( ) - 1 ) . equals ( counts . get ( counts . size ( ) - 2 ) ) && ! counts . get ( counts . size ( ) - 1 ) . equals ( 0 ) ) ++ result ; System . out . println ( result ) ; } }

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 { int N = ints ( ) ; int [ ] nums = ints ( N ) ; Solution obj = new Solution ( ) ; System . out . println ( obj . pairs ( nums , N ) ) ; } }   class Solution { public int pairs ( int [ ] nums , int N ) { Map < Integer , Integer > hm = new HashMap < > ( ) ; for ( int num : nums ) { if ( num == 0 ) continue ; hm . put ( num , hm . getOrDefault ( num , 0 ) + 1 ) ; } int cnt_pairs = 0 ; for ( int freq : hm . values ( ) ) { if ( freq > 2 ) return - 1 ; if ( freq == 2 ) cnt_pairs += 1 ; } return cnt_pairs == 0 ? 0 : cnt_pairs ; } }

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

from collections import Counter   n = int ( input ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) )   count = Counter ( arr ) ans = 0 for key , val in count . items ( ) : if val > 2 and key != 0 : print ( - 1 ) exit ( ) if val == 2 and key != 0 : ans += 1   print ( ans )     NEW_LINE

nenuzhnayadich = input ( ) arr = list ( map ( int , input ( ) . split ( ) ) ) meowcount , x = ( 0 , 0 )     def meow ( x , arr , meowcount ) : if x == len ( arr ) : print ( meowcount ) return ( meowcount ) elif arr . count ( arr [ x ] ) == 2 and arr [ x ] != 0 : meowcount += 1 arr . pop ( x ) return ( meow ( x , arr , meowcount ) ) elif arr . count ( arr [ x ] ) > 2 and arr [ x ] != 0 : print ( - 1 ) return ( - 1 ) elif arr [ x ] == 0 or arr . count ( arr [ x ] ) < 2 : x += 1 return ( meow ( x , arr , meowcount ) )     ''' def ▁ krya ( x , ▁ arr , ▁ meowcount ) : ▁ ▁ ▁ ▁ meow ( x , ▁ arr , ▁ meowcount ) '''     meow ( 0 , arr , 0 ) NEW_LINE

import systrash = int ( input ( ) ) - 1 ID = list ( map ( int , input ( ) . split ( ) ) ) otv = int ( ) ID . sort ( ) i = 0 while i < trash : if ID . count ( ID [ i ] ) == 2 and ID [ i ] != 0 : otv += 1 ID . remove ( ID [ i ] ) ID . remove ( ID [ i ] ) trash -= 2 continue elif ID . count ( ID [ i ] ) > 2 and ID [ i ] != 0 : print ( ' - 1' ) sys . exit ( ) i += 1 print ( otv ) NEW_LINE

n = int ( input ( ) ) li = list ( map ( int , input ( ) . rstrip ( ) . split ( ) ) ) cnt = 0 b = set ( li ) - { 0 } """ if ▁ n = = 1 : ▁ ▁ ▁ ▁ print ( 0 ) else : ▁ ▁ ▁ ▁ li . sort ( ) ▁ ▁ ▁ ▁ # print ( li ) ▁ ▁ ▁ ▁ for ▁ i ▁ in ▁ range ( n - 1 ) : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ if ▁ li [ i ] = = li [ i + 1 ] ▁ and ▁ i < ( n - 2 ) ▁ and ▁ li [ i ] ! = 0 : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ if ▁ li [ i + 1 ] = = li [ i + 2 ] : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ print ( -1 ) ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ exit ( ) ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ else : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ cnt + = 1 ▁ ▁ ▁ ▁ print ( cnt ) """   for i in b : p = li . count ( i ) if p > 2 : print ( - 1 ) exit ( ) elif p == 2 : cnt += 1 print ( cnt )     NEW_LINE

n = int ( input ( ) ) li = list ( map ( int , input ( ) . rstrip ( ) . split ( ) ) ) li . sort ( ) cnt = 0   i = 0 while i < n : if li [ i ] == 0 : i += 1 else : p = li [ i ] cnt1 = 1 j = i + 1 while j < n and li [ j ] == p : cnt1 += 1 j += 1 NEW_LINE


import java . util . Scanner ; public class Clock { public static void main ( String [ ] args ) { Scanner userInput = new Scanner ( System . in ) ; int t = userInput . nextInt ( ) ; for ( int i = 0 ; i < t ; i ++ ) { int n = userInput . nextInt ( ) ; long k = userInput . nextLong ( ) ; int [ ] list = new int [ n ] ; for ( int j = 0 ; j < n ; j ++ ) { list [ j ] = userInput . nextInt ( ) ; } list = transform ( list ) ; if ( k % 2 == 0 ) list = transform ( list ) ; for ( int j : list ) { System . out . print ( j + " ▁ " ) ; } System . out . println ( ) ; } } static int [ ] transform ( int [ ] list ) { int d = list [ 0 ] ; for ( int i = 0 ; i < list . length ; i ++ ) { if ( list [ i ] > d ) d = list [ i ] ; } for ( int i = 0 ; i < list . length ; i ++ ) { list [ i ] = d - list [ i ] ; } return list ; } }

import java . util . Scanner ; public class B1392 { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int T = in . nextInt ( ) ; StringBuilder output = new StringBuilder ( ) ; for ( int t = 0 ; t < T ; t ++ ) { int N = in . nextInt ( ) ; long K = in . nextLong ( ) ; int [ ] A = new int [ N ] ; for ( int n = 0 ; n < N ; n ++ ) { A [ n ] = in . nextInt ( ) ; } op ( A ) ; if ( K % 2 == 0 ) { op ( A ) ; } for ( int a : A ) { output . append ( a ) . append ( ' ▁ ' ) ; } output . append ( ' \n ' ) ; } System . out . print ( output ) ; } private static void op ( int [ ] A ) { int max = Integer . MIN_VALUE ; for ( int a : A ) { max = Math . max ( max , a ) ; } for ( int n = 0 ; n < A . length ; n ++ ) { A [ n ] = max - A [ n ] ; } } }

import java . util . * ; import java . io . * ; import java . math . * ; public class ModelB { public static void main ( String args [ ] ) throws Exception { BufferedReader infile = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( infile . readLine ( ) ) ; int T = Integer . parseInt ( st . nextToken ( ) ) ; StringBuilder sb = new StringBuilder ( ) ; while ( T -- > 0 ) { st = new StringTokenizer ( infile . readLine ( ) ) ; int N = Integer . parseInt ( st . nextToken ( ) ) ; long K = Long . parseLong ( st . nextToken ( ) ) % 2 ; if ( K == 0 ) K = 2 ; int [ ] arr = new int [ N ] ; st = new StringTokenizer ( infile . readLine ( ) ) ; for ( int i = 0 ; i < N ; i ++ ) arr [ i ] = Integer . parseInt ( st . nextToken ( ) ) ; for ( int turns = 0 ; turns < K ; turns ++ ) { int max = arr [ 0 ] ; for ( int x : arr ) max = Math . max ( max , x ) ; for ( int i = 0 ; i < N ; i ++ ) arr [ i ] = max - arr [ i ] ; } for ( int i = 0 ; i < N ; i ++ ) { sb . append ( arr [ i ] ) ; if ( i + 1 < N ) sb . append ( " ▁ " ) ; } sb . append ( " \n " ) ; } System . out . print ( sb ) ; } }

from collections import Counter NEW_LINE t = int ( input ( ) ) NEW_LINE for _ in range ( t ) : NEW_LINE INDENT n , k = map ( int , input ( ) . split ( ) ) NEW_LINE ali = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE q = max ( ali ) NEW_LINE for i in range ( n ) : NEW_LINE INDENT ali [ i ] = q - ali [ i ] NEW_LINE DEDENT if ( k % 2 == 0 ) : NEW_LINE INDENT q = max ( ali ) NEW_LINE for i in range ( n ) : NEW_LINE INDENT ali [ i ] = q - ali [ i ] NEW_LINE DEDENT DEDENT print ( * ali ) NEW_LINE DEDENT

t = int ( input ( ) ) NEW_LINE for _ in range ( t ) : NEW_LINE INDENT n , k = map ( int , input ( ) . split ( ) ) NEW_LINE l = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE a = max ( l ) NEW_LINE l1 = [ ] NEW_LINE for i in l : NEW_LINE INDENT l1 . append ( a - i ) NEW_LINE DEDENT b = max ( l1 ) NEW_LINE l2 = [ ] NEW_LINE for j in l1 : NEW_LINE INDENT l2 . append ( b - j ) NEW_LINE DEDENT if k % 2 == 1 : NEW_LINE INDENT print ( * l1 ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( * l2 ) NEW_LINE DEDENT DEDENT

for _ in range ( int ( input ( ) ) ) : NEW_LINE INDENT n , k = map ( int , input ( ) . split ( ) ) NEW_LINE l = list ( map ( int , input ( ) . split ( ) ) ) NEW_LINE for z in range ( 2 - k % 2 ) : NEW_LINE INDENT d = max ( l ) NEW_LINE for i in range ( len ( l ) ) : NEW_LINE INDENT l [ i ] = d - l [ i ] NEW_LINE DEDENT DEDENT print ( * l ) NEW_LINE DEDENT


import java . io . * ; import java . util . * ; import java . math . * ; import static java . lang . Math . * ; import static java . lang . Integer . parseInt ; import static java . lang . Long . parseLong ; import static java . lang . Double . parseDouble ; import static java . lang . String . * ; public class Main { public static void main ( String [ ] args ) throws IOException { BufferedReader in = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringBuilder out = new StringBuilder ( ) ; StringTokenizer tk ; tk = new StringTokenizer ( in . readLine ( ) ) ; int n = parseInt ( tk . nextToken ( ) ) , t = parseInt ( tk . nextToken ( ) ) , k = parseInt ( tk . nextToken ( ) ) , d = parseInt ( tk . nextToken ( ) ) ; int g = ( n + k - 1 ) / k ; int o1 = 0 , o2 = d ; for ( int i = 0 ; i < g ; i ++ ) { if ( o1 <= o2 ) o1 += t ; else o2 += t ; } if ( max ( o1 , o2 ) < g * t ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; } }

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

import java . util . Scanner ; public class ADrink { public static boolean isAlphaNumeric ( String s ) { return s != null && s . matches ( " ^ [ a - zA - Z0-9 ] * $ " ) ; } public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; int n = input . nextInt ( ) , t = input . nextInt ( ) , k = input . nextInt ( ) , d = input . nextInt ( ) ; int x = t * ( n / k ) ; if ( n % k != 0 ) x += t ; System . out . println ( t + d >= x ? " NO " : " YES " ) ;

import java . util . * ; public class OPPJava {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) , t = sc . nextInt ( ) , k = sc . nextInt ( ) , d = sc . nextInt ( ) ; System . out . println ( ( n - 1 ) / k * t > d ? " YES " : " NO " ) ; }   }

import java . util . Scanner ;   public class CarrotCakes { private static final Scanner SCANNER = new Scanner ( System . in ) ;   public static void main ( String [ ] args ) { int n = SCANNER . nextInt ( ) ; int t = SCANNER . nextInt ( ) ; int k = SCANNER . nextInt ( ) ; int d = SCANNER . nextInt ( ) ;   int g = ( n + k - 1 ) / k ; int o1 = 0 , o2 = d ; for ( int i = 0 ; i < g ; i ++ ) { if ( o1 <= o2 ) o1 += t ; else o2 += t ; }   System . out . println ( Math . max ( o1 , o2 ) < g * t ? " YES " : " NO " ) ; } }

n , t , k , d = map ( int , input ( ) . split ( ) )   c = 0   while c <= d :   n -= k c += t   if n > 0 : print ( " YES " ) else : print ( " NO " )   NEW_LINE

import sysinput = sys . stdin . readlineimport math   def inpit ( ) : NEW_LINE

l1 = input ( ) . split ( ) n = int ( l1 [ 0 ] ) t = int ( l1 [ 1 ] ) k = int ( l1 [ 2 ] ) d = int ( l1 [ 3 ] )   if ( ( - ( - n // k ) ) * t ) <= ( d + t ) : print ( ' NO ' ) else : print ( ' YES ' ) NEW_LINE

from math import ceil   n , t , k , d = map ( int , input ( ) . split ( ) ) time_o = ceil ( n / k ) * t                 if d + t >= time_o : print ( ' NO ' ) else : print ( ' YES ' ) NEW_LINE

n , t , k , d = map ( int , input ( ) . split ( ) ) ar = ( n // k + int ( n % k > 0 ) ) * tdd = d // tn -= dd * kki = ( n // ( k * 2 ) + int ( n % ( 2 * k ) > 0 ) ) * t + dd * tif ki < ar : print ( ' YES ' ) else : print ( ' NO ' ) NEW_LINE


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

import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; long x = in . nextInt ( ) ; while ( x > 0 ) { x -- ; long n = in . nextInt ( ) ; long m = in . nextInt ( ) ; if ( n == 1 ) System . out . println ( "0" ) ; else if ( n == 2 ) System . out . println ( m ) ; else if ( n > 2 ) System . out . println ( 2 * m ) ;    } } }

import java . util . Scanner ;   public class MostUnstableArray {   public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] [ ] array = new int [ n ] [ 2 ] ; for ( int i = 0 ; i < n ; i ++ ) { array [ i ] [ 0 ] = sc . nextInt ( ) ; array [ i ] [ 1 ] = sc . nextInt ( ) ; } for ( int i = 0 ; i < n ; i ++ ) { switch ( array [ i ] [ 0 ] ) { case 1 : System . out . println ( 0 ) ; break ; case 2 : System . out . println ( array [ i ] [ 1 ] ) ; break ; default : System . out . println ( array [ i ] [ 1 ] * 2 ) ; break ; } } } }

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . Arrays ;   public class CF1353A { 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 [ ] nm = Arrays . stream ( br . readLine ( ) . split ( " \\ s + " ) ) . mapToInt ( Integer :: parseInt ) . toArray ( ) ; System . out . println ( Math . min ( 2 , nm [ 0 ] - 1 ) * nm [ 1 ] ) ; } } }

for _ in range ( int ( input ( ) ) ) : arr_size , max_sum = map ( int , input ( ) . split ( ) )   if arr_size == 1 : print ( 0 ) elif arr_size == 2 : print ( max_sum ) else : print ( 2 * max_sum ) NEW_LINE

for _ in range ( int ( input ( ) ) ) : n , m = map ( int , input ( ) . split ( ) ) if n == 1 : print ( 0 ) elif n == 2 : print ( m ) else : print ( 2 * m ) NEW_LINE

t = int ( input ( ) ) for i in range ( t ) : n , m = map ( int , input ( ) . split ( ) ) if n == 1 : print ( 0 ) elif n == 2 : print ( m ) else : print ( 2 * m ) NEW_LINE

for _ in range ( int ( input ( ) ) ) : n , m = map ( int , input ( ) . split ( ) )   print ( m * min ( 2 , n - 1 ) ) NEW_LINE

def main ( ) : t = int ( input ( ) ) for _ in range ( t ) : n , m = map ( int , input ( ) . split ( ) ) if n < 2 : print ( 0 ) elif n == 2 : print ( m ) else : print ( ( m * 2 ) )     if __name__ == ' _ _ main _ _ ' : main ( )     '''  arr = ▁ [ ] ▁ len ( arr ) ▁ = > ▁ nsum ( arr ) ▁ = > ▁ m ans ▁ = > ▁ sum ( arr ) *2 ▁  6 ▁ 5 [ ▁ 0 , ▁ 5 ▁ , 0 ▁ ] [ ▁ 0 , ▁ 2 , ▁ 3 , ▁ 0 ▁ ] ▁ = > ▁ [ ▁ 0 , ▁ 2 ▁ ] ▁ + [ ▁ 2 , ▁ 3 ▁ ] ▁ = > ▁ 2 ▁ + ▁ 1 ▁ = ▁ 3  [ ▁ 0,2,0,3,0 ]   ''' NEW_LINE


import java . io . * ; import java . util . * ;   public class E {   public static void main ( String [ ] args ) { new E ( ) ; } public E ( ) { FastScanner fs = new FastScanner ( ) ; PrintWriter out = new PrintWriter ( System . out ) ; int T = 1 ; while ( T -- > 0 ) { int K = fs . nextInt ( ) ; int [ ] arr = new int [ 1999 ] ; arr [ 0 ] = - 1 ; for ( int i = 1 ; i < arr . length - 1 ; i ++ ) arr [ i ] = 1 ; arr [ arr . length - 1 ] = 2 ; for ( int elem = arr . length - 1 ; elem > 0 ; elem -- ) { int canTake = 1000000 - arr [ elem ] ; canTake = Math . min ( canTake , K ) ; arr [ elem ] += canTake ; K -= canTake ; } out . println ( arr . length ) ; for ( int i = 0 ; i < arr . length ; i ++ ) { if ( i > 0 ) out . print ( " ▁ " ) ; out . print ( arr [ i ] ) ; } out . println ( ) ; } out . close ( ) ; } static class FastScanner { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; StringTokenizer st = new StringTokenizer ( " " ) ; public String next ( ) { while ( ! st . hasMoreElements ( ) ) try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return st . nextToken ( ) ; } int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } }   }

import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; 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 ; InputReader in = new InputReader ( inputStream ) ; PrintWriter out = new PrintWriter ( outputStream ) ; TaskB solver = new TaskB ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; }   static class TaskB { public void solve ( int testNumber , InputReader in , PrintWriter out ) { int K = in . nextInt ( ) ; int b = K + 2000 ; int [ ] res = new int [ 2000 ] ; res [ 0 ] = - 1 ; for ( int i = 1 ; i < 2000 ; i ++ ) { if ( b == 0 ) { break ; } else { if ( b > 1000000 ) { b -= 1000000 ; res [ i ] = 1000000 ; } else { res [ i ] = b ; b = 0 ; } } } out . println ( 2000 ) ; for ( int val : res ) { out . print ( val + " ▁ " ) ; } }   }   static class InputReader { public BufferedReader reader ; public StringTokenizer tokenizer ;   public InputReader ( InputStream stream ) { reader = new BufferedReader ( new InputStreamReader ( stream ) , 32768 ) ; tokenizer = null ; }   public String next ( ) { while ( tokenizer == null || ! tokenizer . hasMoreTokens ( ) ) { try { tokenizer = new StringTokenizer ( reader . readLine ( ) ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } } return tokenizer . nextToken ( ) ; }   public int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; }   } }

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . ArrayList ; import java . util . Arrays ; import java . util . Random ; import java . util . StringTokenizer ; import java . util . stream . IntStream ;   public class Solution { public static void main ( String [ ] args ) throws IOException { FastScanner fs = new FastScanner ( ) ; PrintWriter out = new PrintWriter ( System . out ) ; int tt = 1 ; while ( tt -- > 0 ) { int k = fs . nextInt ( ) ; int a = k + 1 ; out . println ( 1002 ) ; out . print ( " - 1 ▁ " ) ; for ( int i = 0 ; i < 1001 ; i ++ ) { int ans = 1 ; ans += Math . min ( ( int ) 1e6 - 1 , a ) ; a -= Math . min ( ( int ) 1e6 - 1 , a ) ; out . print ( ans + " ▁ " ) ; } out . println ( ) ; } out . close ( ) ; } static final Random random = new Random ( ) ; static < T > void shuffle ( T [ ] arr ) { int n = arr . length ; for ( int i = 0 ; i < n ; i ++ ) { int k = random . nextInt ( n ) ; T temp = arr [ k ] ; arr [ k ] = arr [ i ] ; arr [ i ] = temp ; } } static void ruffleSort ( int [ ] a ) { int n = a . length ;

n = int ( input ( ) ) ans = [ - 1 ] n += 1 while n > 0 : n += 1 add = min ( n , 1000000 ) ans . append ( add ) n -= addprint ( len ( ans ) ) for i in ans : print ( i , end = " ▁ " ) print ( ) NEW_LINE

def solve ( Z ) : if Z <= 1000000 - 10 : return [ - 1 , Z + 2 ] for l in range ( 2000 ) : m = l + 1 if m < 4 or m > 2000 : continue Y = ( Z + 1 ) // ( m - 1 ) + 1 c = Y * ( m - 1 ) - ( Z + 1 ) X = Y + c + 1 if X >= 1000000 or Y + 2 >= 1000000 : continue if Y >= m / 2 - 1 : ans = [ X , - ( X + 1 ) ] for _ in range ( m - 4 ) : ans . append ( 0 ) ans . append ( - 1 ) ans . append ( Y + 2 )           return ans return - 1   Z = int ( input ( ) ) ans = solve ( Z ) print ( len ( ans ) ) print ( ' ▁ ' . join ( [ str ( x ) for x in ans ] ) ) NEW_LINE

k = int ( input ( ) ) ans = [ - 1 ] while sum ( ans ) - len ( ans ) + 1 != k : ans . append ( min ( 10 ** 6 , k + len ( ans ) - sum ( ans ) ) ) print ( len ( ans ) ) print ( * ans ) NEW_LINE


import java . io . * ; import java . util . * ;   public class A { private BufferedReader reader ; private StreamTokenizer tokenizer ;

import java . io . * ; import java . lang . reflect . Array ; import java . util . * ;   public class Main {   public static int gcd ( int a , int b ) { while ( b != 0 ) { int tmp = a % b ; a = b ; b = tmp ; } return a ; }   public static void main ( String [ ] args ) throws IOException { FastScanner in = new FastScanner ( System . in ) ; FastPrinter out = new FastPrinter ( System . out ) ;

d = { } m , k = map ( int , input ( ) . split ( ) ) for i in range ( m ) : a , b = map ( int , input ( ) . split ( ) ) d . setdefault ( a , set ( ) ) . add ( b ) d . setdefault ( b , set ( ) ) . add ( a ) for x in sorted ( d ) : s = [ ] for y in sorted ( d ) : if x == y or y in d [ x ] : continue if len ( d [ x ] & d [ y ] ) * 100 >= k * len ( d [ x ] ) : s += [ str ( y ) ] print ( str ( x ) + ' : ' , len ( s ) , ' ▁ ' . join ( s ) ) NEW_LINE

f = lambda : map ( int , input ( ) . split ( ) ) g = lambda x , y : d . setdefault ( x , set ( ) ) . add ( y ) d = { } m , k = f ( ) for i in range ( m ) : a , b = f ( ) g ( a , b ) g ( b , a ) t = sorted ( d ) for a in t : s = [ str ( b ) for b in t if a != b and b not in d [ a ] and len ( d [ a ] & d [ b ] ) * 100 >= k * len ( d [ a ] ) ] print ( str ( a ) + ' : ' , len ( s ) , ' ▁ ' . join ( s ) ) NEW_LINE

f = lambda : map ( int , input ( ) . split ( ) ) g = lambda x , y : d . setdefault ( x , set ( ) ) . add ( y ) h = lambda b : a == b or b in d [ a ] or len ( d [ a ] & d [ b ] ) * 100 < k * len ( d [ a ] ) d = { } m , k = f ( ) for i in range ( m ) : a , b = f ( ) g ( a , b ) g ( b , a ) t = sorted ( d ) for a in t : s = [ str ( b ) for b in t if not h ( b ) ] print ( str ( a ) + ' : ' , len ( s ) , ' ▁ ' . join ( s ) ) NEW_LINE


import java . util . Scanner ; public class Main {   public static void main ( String [ ] args ) { Scanner keyBoard = new Scanner ( System . in ) ; String regeX = keyBoard . nextLine ( ) ; String [ ] separados = regeX . split ( " ▁ " ) ;   int n1 = Integer . parseInt ( separados [ 0 ] ) ; int n2 = Integer . parseInt ( separados [ 1 ] ) ; int k1 = Integer . parseInt ( separados [ 2 ] ) ; int k2 = Integer . parseInt ( separados [ 3 ] ) ;   if ( n1 > n2 ) { System . out . println ( " First " ) ; } else { System . out . println ( " Second " ) ; }   } }

import java . util . * ; import static java . lang . Math . cbrt ;   public class Test { public static void main ( String [ ] args ) throws Exception {   Scanner input = new Scanner ( System . in ) ; int n1 = input . nextInt ( ) ; int n2 = input . nextInt ( ) ; int k1 = input . nextInt ( ) ; int k2 = input . nextInt ( ) ;   System . out . println ( n1 > n2 ? " First " : " Second " ) ; } }

import java . util . Scanner ;   public class Main { public static void main ( String [ ] args ) { int jugador1 , jugador2 , lanzamientos1 , lanzamientos2 ; Scanner teclado = new Scanner ( System . in ) ; jugador1 = teclado . nextInt ( ) ; jugador2 = teclado . nextInt ( ) ; if ( jugador1 > jugador2 ) { System . out . println ( " First " ) ; } else { System . out . println ( " Second " ) ; } }   }

def str_list ( s , char ) : output_list = [ ] collector = " " for i in range ( len ( s ) ) : if s [ i ] == char : if collector : output_list . append ( int ( collector ) ) collector = " " else : collector += s [ i ] output_list . append ( int ( collector ) ) return output_list     def list_str ( l , char ) : output_str = " " for i in range ( len ( l ) - 1 ) : output_str += str ( l [ i ] ) + char output_str += str ( l [ len ( l ) - 1 ] ) return output_str     def main_function ( ) : n_1 , n_2 , k_1 , k_2 = str_list ( input ( ) , " ▁ " ) ratio_1 = n_1 // k_1 ratio_2 = n_2 // k_2 if n_1 > n_2 : return " First " else : return " Second "     print ( main_function ( ) )   NEW_LINE

a = list ( map ( int , input ( ) . split ( " ▁ " ) ) ) if ( a [ 0 ] > a [ 1 ] ) : print ( " First " ) else : print ( " Second " ) NEW_LINE

n1 , n2 , k1 , k2 = map ( int , input ( ) . split ( ) ) flag1 = 0 flag2 = 0 i = 1 while True : if i % 2 != 0 : if n1 < 1 : flag1 = 1 break else : n1 -= 1 if n1 < 1 : flag1 = 1 break else : if n2 < 1 : flag2 = 1 break else : n2 -= 1 if n2 < 1 : flag2 = 1 break i += 1 if flag1 == 1 : print ( " Second " ) else : print ( " First " ) NEW_LINE

if __name__ == " _ _ main _ _ " : n1 , n2 , k1 , k2 = list ( map ( int , input ( ) . split ( ) ) ) if n2 >= n1 : print ( ' Second ' ) else : print ( ' First ' ) NEW_LINE

n1 , n2 , k1 , k2 = map ( int , input ( ) . split ( ) )   if n1 > n2 : print ( " First " ) else : print ( " Second " ) NEW_LINE


import java . io . * ; import java . util . ArrayDeque ; import java . util . Arrays ; import java . util . StringTokenizer ;   public class Polygons {   public static void main ( String [ ] args ) throws IOException {   FastReader reader = new FastReader ( ) ; FastWriter writer = new FastWriter ( ) ; int n = reader . readSingleInt ( ) ;   int [ ] [ ] points = new int [ n ] [ 2 ] ; for ( int i = 0 ; i < n ; i ++ ) { points [ i ] = reader . readIntArray ( 2 ) ; }   int [ ] [ ] [ ] convexHullHalves = getConvexHull ( points ) ;

def convex_hull ( points ) : points = sorted ( set ( points ) )   if len ( points ) <= 1 : return points   def cross ( o , a , b ) : return ( a [ 0 ] - o [ 0 ] ) * ( b [ 1 ] - o [ 1 ] ) - ( a [ 1 ] - o [ 1 ] ) * ( b [ 0 ] - o [ 0 ] )   lower = [ ] for p in points : while len ( lower ) >= 2 and cross ( lower [ - 2 ] , lower [ - 1 ] , p ) < 0 : lower . pop ( ) lower . append ( p )   upper = [ ] for p in reversed ( points ) : while len ( upper ) >= 2 and cross ( upper [ - 2 ] , upper [ - 1 ] , p ) < 0 : upper . pop ( ) upper . append ( p )   return lower [ : - 1 ] + upper [ : - 1 ]     def d ( ) : total = [ ]   n = int ( input ( ) ) a , b = [ ] , [ ] for i in range ( n ) : x , y = map ( int , input ( ) . split ( ) ) total . append ( ( x , y ) ) a . append ( ( x , y ) )   m = int ( input ( ) )   for j in range ( m ) : x , y = map ( int , input ( ) . split ( ) ) total . append ( ( x , y ) ) b . append ( ( x , y ) ) set_a = set ( ) for i in a : set_a . add ( i ) for j in b : if ( j in set_a ) : print ( " NO " ) return     if ( sorted ( a ) == sorted ( convex_hull ( total ) ) ) : print ( " YES " ) else : print ( " NO " )   d ( ) NEW_LINE

from functools import reducedef convex_hull_graham ( points ) : TURN_LEFT , TURN_RIGHT , TURN_NONE = ( 1 , - 1 , 0 ) def cmp ( a , b ) : return ( a > b ) - ( a < b )   def turn ( p , q , r ) : return cmp ( ( q [ 0 ] - p [ 0 ] ) * ( r [ 1 ] - p [ 1 ] ) - ( r [ 0 ] - p [ 0 ] ) * ( q [ 1 ] - p [ 1 ] ) , 0 )   def _keep_left ( hull , r ) : while len ( hull ) > 1 and turn ( hull [ - 2 ] , hull [ - 1 ] , r ) not in { TURN_LEFT , TURN_NONE } : NEW_LINE

from math import * from collections import defaultdict as ddfrom sys import stdin , stdout , setrecursionlimit as srlfrom bisect import bisect_right as br , bisect_left as blfrom heapq import heapify , heappush as hpush , heappop as hpopsrl ( 10 ** 6 + 999 ) ; mod = int ( 1e9 ) + 7 ; yes = ' YES ' ; no = ' NO ' ; class graph : def __init__ ( self , n ) : self . d = dd ( list ) self . vis = [ 0 ] * ( n + 1 ) self . dp = [ [ 0 , 0 ] for i in range ( n + 1 ) ] def addvrtx ( self , src , dest ) : self . d [ src ] . append ( dest ) self . d [ dest ] . append ( src ) def value ( a , b , c ) : return a [ 0 ] * ( b [ 1 ] - c [ 1 ] ) + b [ 0 ] * ( c [ 1 ] - a [ 1 ] ) + c [ 0 ] * ( a [ 1 ] - b [ 1 ] ) def cw ( a , b , c ) : return value ( a , b , c ) > 0 def acw ( a , b , c ) : return value ( a , b , c ) < 0 def collinear ( a , b , c ) : return value ( a , b , c ) == 0 def ConvexHull ( p , n ) : if ( n <= 2 ) : return p . sort ( ) p1 = p [ 0 ] NEW_LINE


import java . math . BigDecimal ; import java . math . BigInteger ; import java . util . * ;   public class Main { static final int N = 110 ; static int n , m ; static long sum = 0 ; static long [ ] [ ] [ ] d = new long [ N ] [ N ] [ N ] ; static long [ ] cnt = new long [ N ] ; static int [ ] a = new int [ N ] ; static BigInteger [ ] big = new BigInteger [ N ] ; public static void main ( String [ ] args ) { Scanner reader = new Scanner ( System . in ) ; n = reader . nextInt ( ) ; for ( int i = 1 ; i <= n ; ++ i ) { a [ i ] = reader . nextInt ( ) ; sum += a [ i ] ; } m = reader . nextInt ( ) ; if ( sum <= m ) { System . out . println ( n ) ; return ; } for ( int i = 1 ; i <= n ; ++ i ) d [ i ] [ 0 ] [ 0 ] = 1 ; for ( int o = 1 ; o <= n ; ++ o ) { for ( int i = 1 ; i <= n ; ++ i ) { if ( i == o ) continue ; for ( int j = i - 1 ; j >= 0 ; -- j ) for ( int k = m ; k >= 0 ; -- k ) { if ( k + a [ i ] > m ) cnt [ j + 1 ] += d [ o ] [ k ] [ j ] ; else d [ o ] [ k + a [ i ] ] [ j + 1 ] += d [ o ] [ k ] [ j ] ; } } }

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . Arrays ; import java . util . Random ; import java . util . StringTokenizer ;   public class Solution { static final int max = 55 ; public static void main ( String [ ] args ) throws IOException { FastScanner fs = new FastScanner ( ) ; PrintWriter out = new PrintWriter ( System . out ) ; int tt = 1 ; while ( tt -- > 0 ) { int n = fs . nextInt ( ) ; int sum = 0 ; int [ ] a = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { a [ i ] = fs . nextInt ( ) ; sum += a [ i ] ; } int p = fs . nextInt ( ) ; if ( sum <= p ) { out . println ( n ) ; out . flush ( ) ; return ; } double [ ] fact = new double [ max ] ; fact [ 0 ] = 1 ; for ( int i = 1 ; i < max ; i ++ ) fact [ i ] = fact [ i - 1 ] * i ;

n = int ( input ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) p = int ( input ( ) ) dp = [ [ [ 0 for k in range ( n + 1 ) ] for i in range ( p + 1 ) ] for i in range ( n + 1 ) ] for j in range ( p + 1 ) : for k in range ( n + 1 ) : dp [ 0 ] [ j ] [ k ] = 1 for i in range ( 1 , n + 1 ) : for j in range ( p + 1 ) : for k in range ( 1 , n + 1 ) : if j >= arr [ k - 1 ] : dp [ i ] [ j ] [ k ] = dp [ i ] [ j ] [ k - 1 ] + i * dp [ i - 1 ] [ j - arr [ k - 1 ] ] [ k - 1 ] else : dp [ i ] [ j ] [ k ] = dp [ i ] [ j ] [ k - 1 ] fact = nans = 0 for i in range ( 1 , n + 1 ) : ans += dp [ i ] [ p ] [ n ] / fact fact *= ( n - i ) print ( ans ) NEW_LINE

import math   n = int ( input ( ) ) a = [ int ( x ) for x in input ( ) . split ( ) ] p = int ( input ( ) )   sum = 0 ; for x in range ( n ) : sum += a [ x ] if ( sum <= p ) : print ( n ) else : ans = 0 for i in range ( n ) : dp = [ [ [ 0 for z in range ( 55 ) ] for y in range ( 55 ) ] for x in range ( 55 ) ] dp [ - 1 ] [ 0 ] [ 0 ] = 1 for j in range ( n ) : if ( j == i ) :   for k in range ( n ) : for z in range ( p + 1 ) : dp [ j ] [ k ] [ z ] = dp [ j - 1 ] [ k ] [ z ] continue   for k in range ( n ) :   for z in range ( p + 1 ) :   if ( z + a [ j ] <= p ) : dp [ j ] [ k + 1 ] [ z + a [ j ] ] += dp [ j - 1 ] [ k ] [ z ] dp [ j ] [ k ] [ z ] += dp [ j - 1 ] [ k ] [ z ]     for k in range ( n ) : for z in range ( p + 1 ) : if ( z + a [ i ] > p ) : ans += k * dp [ n - 1 ] [ k ] [ z ] * math . factorial ( k ) * math . factorial ( n - k - 1 )   print ( ans / math . factorial ( n ) ) NEW_LINE

n = input ( ) n = int ( n ) arr = [ 0 ] * nfact = [ 0 ] * 51 a = input ( ) . split ( ) p = input ( ) p = int ( p )   for i in range ( n ) : arr [ i ] = int ( a [ i ] )   if n == 1 : if arr [ 0 ] <= p : print ( 1 ) else : print ( 0 ) exit ( 0 )   def pre ( ) : fact [ 0 ] = 1 for i in range ( 1 , 51 ) : fact [ i ] = fact [ i - 1 ] * i   def get ( arr , min_sum , max_sum ) : ways = [ [ 0 for i in range ( max_sum + 1 ) ] for i in range ( len ( arr ) + 1 ) ] ways [ 0 ] [ 0 ] = 1 for i in range ( len ( arr ) ) : for j in range ( i , - 1 , - 1 ) : for k in range ( max_sum , - 1 , - 1 ) : if k + arr [ i ] <= max_sum : ways [ j + 1 ] [ k + arr [ i ] ] += ways [ j ] [ k ]   ans = 0 counted = 0 for i in range ( 0 , len ( arr ) + 1 ) : for j in range ( min_sum , max_sum + 1 ) : ans += fact [ i ] * fact [ n - i - 1 ] * ways [ i ] [ j ] * i counted += fact [ i ] * fact [ n - i - 1 ] * ways [ i ] [ j ]   return ans , counted   pre ( ) tot = 0 count = 0 sm = 0 for i in range ( n ) : sm += arr [ i ] arr1 = [ 0 ] * ( n - 1 ) got = 0 for j in range ( n ) : if j == i : continue arr1 [ got ] = arr [ j ] got += 1 how_many = get ( arr1 , max ( 0 , p - arr [ i ] + 1 ) , p ) tot += how_many [ 0 ] count += how_many [ 1 ]   def get_div ( a , b ) : NEW_LINE

from pprint import pprint   n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) p = int ( input ( ) )   fact = [ 1 ]   for i in range ( 1 , 51 ) : fact . append ( fact [ - 1 ] * i )   if sum ( a ) <= p : print ( n ) else :   dp = [ [ 0 ] * 56 for _ in range ( 56 ) ] dp [ 0 ] [ 0 ] = 1 for i in range ( n ) : for j in range ( n , - 1 , - 1 ) : for k in range ( p ) : if a [ i ] + k <= p : dp [ a [ i ] + k ] [ j + 1 ] += dp [ k ] [ j ]   tot = sum ( dp [ j ] [ i ] * fact [ i ] * fact [ n - i ] for i in range ( 1 , n + 1 ) for j in range ( 1 , p + 1 ) )   print ( f ' { tot / fact [ n ] : . 9f } ' ) NEW_LINE

n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) p = int ( input ( ) )   fact = [ 1 ]   for i in range ( 1 , 51 ) : fact . append ( fact [ - 1 ] * i )   if sum ( a ) <= p : print ( n ) else :   dp = [ [ 0 ] * 56 for _ in range ( 56 ) ] dp [ 0 ] [ 0 ] = 1 for i in range ( n ) : for j in range ( n , - 1 , - 1 ) : for k in range ( p ) : if a [ i ] + k <= p : dp [ j + 1 ] [ a [ i ] + k ] += dp [ j ] [ k ]   tot = sum ( dp [ i ] [ j ] * fact [ i ] * fact [ n - i ] for j in range ( 1 , p + 1 ) for i in range ( 1 , n + 1 ) )   print ( f ' { tot / fact [ n ] : . 9f } ' ) NEW_LINE


import java . io . BufferedReader ; import java . io . InputStreamReader ; import java . io . IOException ; import java . util . StringTokenizer ; import java . util . Arrays ; public class Solution { public static void main ( String [ ] args ) { try ( BufferedReader in = new BufferedReader ( new InputStreamReader ( System . in ) ) ) { char [ ] word = in . readLine ( ) . toCharArray ( ) ; boolean flag = false ; for ( int i = 0 ; i < word . length ; i ++ ) { if ( word [ i ] != ' a ' ) { word [ i ] = ( char ) ( word [ i ] - 1 ) ; flag = true ; } else if ( flag ) { break ; } } if ( ! flag ) word [ word . length - 1 ] = ' z ' ; System . out . println ( word ) ; } catch ( IOException e ) { } } }

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ;   public class test { public static void main ( String ... args ) throws NumberFormatException , IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String s = br . readLine ( ) ; char [ ] a = s . toCharArray ( ) ; int i = 0 ; int n = s . length ( ) ; while ( i < n && a [ i ] == ' a ' ) { i ++ ; } if ( i == n ) { a [ n - 1 ] = ' z ' ; } else { while ( i < n && a [ i ] != ' a ' ) { a [ i ] = ( char ) ( a [ i ] - 1 ) ; i ++ ; } } System . out . println ( new String ( a ) ) ; } }

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ;   public class LettersShift { public static void main ( String [ ] args ) throws IOException { BufferedReader r = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String s = r . readLine ( ) ; char [ ] o = s . toCharArray ( ) ; int j = 0 ; for ( ; j < o . length - 1 ; j ++ ) if ( o [ j ] > n ( o [ j ] ) ) break ; for ( int i = j ; i < o . length ; i ++ ) if ( i != j && o [ i ] < n ( o [ i ] ) ) break ; else o [ i ] = n ( o [ i ] ) ; System . out . println ( new String ( o ) ) ; }   public static char n ( char c ) { return c == ' a ' ? ' z ' : ( char ) ( c - 1 ) ; } }

from collections import defaultdictimport sysimport mathdef input ( ) : return sys . stdin . readline ( ) . strip ( ) def iinput ( ) : return int ( input ( ) ) def minput ( ) : return map ( int , input ( ) . split ( ) ) def listinput ( ) : return list ( map ( int , input ( ) . split ( ) ) ) """ ▁ a = input ( ) b = input ( ) c = input ( ) a + = bif ▁ len ( a ) ! = len ( c ) : ▁ ▁ ▁ ▁ print ( " NO " ) else : ▁ ▁ ▁ ▁ orig , check = { } , { } ▁ ▁ ▁ ▁ for ▁ i ▁ in ▁ range ( len ( a ) ) : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ orig [ a [ i ] ] = orig . get ( a [ i ] ,0 ) + 1 ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ check [ c [ i ] ] = check . get ( c [ i ] ,0 ) + 1 ▁ ▁ ▁ ▁ k = list ( set ( map ( str , a ) ) ) ▁ ▁ ▁ ▁ answer = " YES " ▁ ▁ ▁ ▁ for ▁ i ▁ in ▁ k : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ if ▁ orig . get ( i , 0 ) ! = check . get ( i , 0 ) : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ answer = " NO " ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ break ▁ ▁ ▁ ▁ print ( answer ) ▁ """ """ ▁ l = listinput ( ) l . insert ( 0,999 ) for ▁ i ▁ in ▁ range ( 1 , len ( l ) ) : ▁ ▁ ▁ ▁ d = { } ▁ ▁ ▁ ▁ while ▁ True : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ d [ i ] = d . get ( i , 0 ) + 1 ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ i = l [ i ] ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ if ▁ d . get ( i , 0 ) = = 2 : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ print ( i , end = ' ▁ ' ) ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ break ▁ """ """ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ n = iinput ( ) answer = 0for ▁ i ▁ in ▁ range ( n / /1234567 + 1 ) : ▁ ▁ ▁ ▁ for ▁ j ▁ in ▁ range ( ( n - i * 1234567 ) / /123456 + 1 ) : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ if ▁ ( n - i * 1234567 - j * 123456 ) % 1234 = = 0 : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ answer = 1 ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ break ▁ ▁ ▁ ▁ if ▁ answer : ▁ ▁ ▁ ▁ ▁ ▁ ▁ ▁ breakif ▁ answer : ▁ ▁ ▁ ▁ print ( " YES " ) else : ▁ ▁ ▁ ▁ print ( " NO " ) ▁ """ s = list ( map ( str , input ( ) ) ) i = 0 while i < len ( s ) and s [ i ] == ' a ' : i += 1 if i == len ( s ) : print ( ' ' . join ( s ) [ : - 1 ] + ' z ' ) else : while i < len ( s ) and s [ i ] != ' a ' : s [ i ] = chr ( ord ( s [ i ] ) - 1 ) i += 1 print ( ' ' . join ( s ) ) NEW_LINE

s = input ( ) if len ( set ( s ) ) == 1 and s [ 0 ] == ' a ' : print ( s [ : - 1 ] + ' z ' ) exit ( ) j = 0 for i in range ( len ( s ) ) : if s [ i ] == ' a ' and j != 0 : print ( s [ i : ] ) break else : if s [ i ] == ' a ' : print ( s [ i ] , end = ' ' ) else : j += 1 print ( chr ( ord ( s [ i ] ) - 1 ) , end = ' ' ) print ( ) NEW_LINE


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

import java . lang . * ; import java . util . * ; import java . util . stream . Collectors ; import java . io . * ;   public class pblm3 { static class Pair { int i ; int j ; public Pair ( int x , int y ) { this . i = x ; this . j = y ; } } public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; Pair [ ] ar = new Pair [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { ar [ i ] = new Pair ( sc . nextInt ( ) , sc . nextInt ( ) ) ; } int m = sc . nextInt ( ) ; Pair [ ] br = new Pair [ m ] ; for ( int i = 0 ; i < m ; i ++ ) { br [ i ] = new Pair ( sc . nextInt ( ) , sc . nextInt ( ) ) ; } Arrays . sort ( ar , ( a , b ) -> { if ( a . i == b . i ) return a . j - b . j ; else return a . i - b . i ; } ) ; Arrays . sort ( br , ( a , b ) -> { if ( a . i == b . i ) return a . j - b . j ; else return a . i - b . i ; } ) ; int diff = 0 ;

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

""" ▁ Created ▁ by ▁ Henrikh ▁ Kantuni ▁ on ▁ 3/15/17 ▁ """   if __name__ == " _ _ main _ _ " : n = int ( input ( ) ) min_r1 = 2 * 10 ** 9 max_l1 = 0   while n > 0 : l1 , r1 = [ int ( x ) for x in input ( ) . split ( ) ] if r1 < min_r1 : min_r1 = r1 if l1 > max_l1 : max_l1 = l1 n -= 1   m = int ( input ( ) ) min_r2 = 2 * 10 ** 9 max_l2 = 0   while m > 0 : l2 , r2 = [ int ( x ) for x in input ( ) . split ( ) ] if r2 < min_r2 : min_r2 = r2 if l2 > max_l2 : max_l2 = l2 m -= 1   if max_l2 - min_r1 >= 0 and max_l1 - min_r2 >= 0 : print ( max ( max_l2 - min_r1 , max_l1 - min_r2 ) ) elif max_l2 - min_r1 >= 0 : print ( max_l2 - min_r1 ) elif max_l1 - min_r2 >= 0 : print ( max_l1 - min_r2 ) else : print ( 0 ) NEW_LINE

a , b , c , d = [ ] , [ ] , [ ] , [ ] n = int ( input ( ) ) for _ in range ( n ) : l1 , r1 = map ( int , input ( ) . split ( ) ) a . append ( r1 ) c . append ( l1 ) m = int ( input ( ) ) for _ in range ( m ) : l2 , r2 = map ( int , input ( ) . split ( ) ) b . append ( l2 ) d . append ( r2 ) if min ( a ) >= max ( b ) and min ( d ) >= max ( c ) : print ( 0 ) else : print ( max ( max ( b ) - min ( a ) , max ( c ) - min ( d ) ) ) NEW_LINE

n = int ( input ( ) ) mn1 = 100000000000000 mx2 = 1 for i in range ( n ) : l , r = map ( int , input ( ) . split ( ) ) if r < mn1 : mn1 = r if l > mx2 : mx2 = l m = int ( input ( ) ) mx1 = 1 mn2 = 10000000000000000 for i in range ( m ) : l , r = map ( int , input ( ) . split ( ) ) if l > mx1 : mx1 = l if r < mn2 : mn2 = r if mx1 - mn1 <= 0 and mx2 - mn2 <= 0 : print ( 0 ) else : print ( max ( mx1 - mn1 , mx2 - mn2 ) ) NEW_LINE

n = int ( input ( ) ) maxln = 0 minrn = 10 ** 9 + 1 for i in range ( n ) : l , r = map ( int , input ( ) . split ( ) ) maxln = max ( l , maxln ) minrn = min ( r , minrn ) m = int ( input ( ) ) ans = - 1 for i in range ( m ) : l , r = map ( int , input ( ) . split ( ) ) if l > minrn : ans = max ( ans , l - minrn ) if r < maxln : ans = max ( ans , maxln - r ) ans = max ( 0 , ans ) print ( ans ) NEW_LINE

n = int ( input ( ) ) a = 1e10 b = 0 for _ in range ( n ) : x , y = map ( int , input ( ) . split ( ) ) if ( y < a ) : a = int ( y ) if ( x > b ) : b = x   m = int ( input ( ) ) c = 1e10 d = 0 for _ in range ( m ) : x , y = map ( int , input ( ) . split ( ) ) if ( y < c ) : c = int ( y ) if ( x > d ) : d = x NEW_LINE


import java . util . * ;   public class CF102 { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int q = sc . nextInt ( ) ; for ( int i = 0 ; i < q ; i ++ ) { int n = sc . nextInt ( ) ; List < Integer > list = new ArrayList < > ( ) ;   for ( int j = 0 ; j < n ; j ++ ) { list . add ( sc . nextInt ( ) ) ; } int index_1 = list . indexOf ( 1 ) ; boolean checkcase1 = true ; for ( int j = 0 ; j <= index_1 ; j ++ ) { if ( list . get ( j ) != ( index_1 + 1 - j ) ) { checkcase1 = false ; break ; } } int num = n ; for ( int j = index_1 + 1 ; j < n ; j ++ ) { if ( list . get ( j ) != num ) { checkcase1 = false ; break ; } else { num -= 1 ; } } boolean checkcase2 = true ; int num1 = 1 ; for ( int j = index_1 ; j < n ; j ++ ) { if ( list . get ( j ) != num1 ) { checkcase2 = false ; break ; } else { num1 += 1 ; } }

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

import java . util . * ; import java . lang . * ; import java . util . * ; public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; for ( int p = 0 ; p < t ; p ++ ) { int n = sc . nextInt ( ) ; String ans = " " ; int prev = - 1 ; boolean c = true ; boolean d = true ; for ( int i = 0 ; i < n ; i ++ ) { int a = sc . nextInt ( ) ; if ( prev != - 1 ) { if ( c && a % n != ( prev + 1 ) % n ) { c = false ;   } if ( d && a % n != ( n + prev - 1 ) % n ) { d = false ; } } prev = a ; } if ( c || d ) ans = " YES " ; else ans = " NO " ; System . out . println ( ans ) ; } } }

import java . util . * ; public class Main { 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 pos = - 1 ; boolean lrot = true ; boolean rrot = true ; int [ ] arr = new int [ n ] ;   for ( int j = 0 ; j < n ; j ++ ) { arr [ j ] = sc . nextInt ( ) ;   if ( arr [ j ] == 1 ) { pos = j ; } }   for ( int j = 1 ; j < n ; j ++ ) { lrot &= ( arr [ ( pos - j + n ) % n ] == j + 1 ) ; rrot &= ( arr [ ( pos + j + n ) % n ] == j + 1 ) ; }   if ( lrot || rrot ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; } } }

import java . util . * ;    public class Practise {

t = int ( input ( ) ) res = [ ] for i in range ( t ) : n = int ( input ( ) ) a = list ( map ( int , input ( ) . split ( ) ) ) s = a . index ( 1 ) f = 1 nxt = ( s + 1 ) % n if ( a [ nxt ] - a [ s ] == 1 ) : nxt = ( s + 1 ) % n while ( a [ nxt ] != 1 ) : if ( a [ nxt ] - a [ s ] == 1 ) : s = ( s + 1 ) % n else : res . append ( " NO " ) f = 0 break nxt = ( s + 1 ) % n else : nxt = s - 1 if ( nxt < 0 ) : nxt = n - 1 while ( a [ nxt ] != 1 ) : if ( a [ nxt ] - a [ s ] == 1 ) : s -= 1 if ( s < 0 ) : s = n - 1 else : res . append ( " NO " ) f = 0 break nxt = s - 1 if ( nxt < 0 ) : nxt = n - 1 if ( f == 1 ) : res . append ( " YES " ) for i in res : print ( i ) NEW_LINE

from sys import stdin , stdoutfrom collections import Counter NEW_LINE

for _ in range ( int ( input ( ) ) ) : n = int ( input ( ) ) l = list ( map ( int , input ( ) . split ( ) ) ) l1 = sorted ( l ) i = l . index ( 1 ) lr = l [ i + 1 : ] if len ( lr ) != n : ll = l [ : i ] else : ll = [ ] if [ 1 ] + lr + ll == l1 : print ( " YES " ) elif [ 1 ] + ll [ : : - 1 ] + lr [ : : - 1 ] == l1 : print ( " YES " ) else : print ( " NO " ) NEW_LINE

def solve ( ) : n = int ( input ( ) ) p = list ( map ( int , input ( ) . split ( ) ) ) is_clockwise , is_counterclockwise = True , True idx_first = p . index ( 1 ) for i in range ( n ) : if p [ ( idx_first + i ) % n ] != i + 1 : is_clockwise = False break idx_last = p . index ( n ) for i in range ( n ) : if p [ ( idx_last + i ) % n ] != n - i : is_counterclockwise = False break if is_clockwise or is_counterclockwise : print ( ' YES ' ) else : print ( ' NO ' )   q = int ( input ( ) ) for _ in range ( q ) : solve ( ) NEW_LINE

q = int ( input ( ) )   for bruh in range ( q ) : n = int ( input ( ) ) students = list ( map ( int , input ( ) . split ( ) ) )   i = students . index ( 1 )   new_order = students [ i + 1 : ] + students [ : i ]   if new_order == sorted ( new_order ) or new_order == sorted ( new_order , reverse = True ) : print ( " YES " ) else : print ( " NO " ) NEW_LINE


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

import java . io . BufferedReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . util . StringTokenizer ;   public class A_Translation { public static void main ( String [ ] args ) { FastScanner fs = new FastScanner ( ) ; String s = fs . next ( ) , t = fs . next ( ) ;   System . out . println ( ( s . equals ( new StringBuilder ( t ) . reverse ( ) . toString ( ) ) ) ? " YES " : " NO " ) ; }   static int min ( int a , int b ) { return Math . min ( a , b ) ; }   static int max ( int a , int b ) { return Math . max ( a , b ) ; }   static long min ( long a , long b ) { return Math . min ( a , b ) ; }   static long max ( long a , long b ) { return Math . max ( a , b ) ; }   static class FastScanner { BufferedReader br ; StringTokenizer st ;   public FastScanner ( ) { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; }   String next ( ) { while ( st == null || ! st . hasMoreElements ( ) ) { try { st = new StringTokenizer ( br . readLine ( ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } return st . nextToken ( ) ; }   int nextInt ( ) { return Integer . parseInt ( next ( ) ) ; } long nextLong ( ) { return Long . parseLong ( next ( ) ) ; } double nextDouble ( ) { return Double . parseDouble ( next ( ) ) ; } char nextChar ( ) { return next ( ) . charAt ( 0 ) ; }   String nextLine ( ) { String str = " " ; try { str = br . readLine ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return str ; } } }

import java . io . OutputStream ; import java . io . IOException ; import java . io . InputStream ; import java . io . PrintWriter ; 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 ) ; ATranslation solver = new ATranslation ( ) ; solver . solve ( 1 , in , out ) ; out . close ( ) ; }   static class ATranslation { public void solve ( int testNumber , FastScanner fs , PrintWriter out ) { String s = fs . next ( ) , t = fs . next ( ) ; if ( s . equals ( new StringBuilder ( t ) . reverse ( ) . toString ( ) ) ) { out . println ( " YES " ) ; } else { out . println ( " NO " ) ; } }   }   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 . * ; import java . math . * ; import java . security . * ; import java . text . * ; import java . util . * ; import java . util . concurrent . * ; import java . util . function . * ; import java . util . regex . * ; import java . util . stream . * ; import static java . util . stream . Collectors . joining ; import static java . util . stream . Collectors . toList ;   public class Solution {   public static void main ( String args [ ] ) { Scanner scan = new Scanner ( System . in ) ; String b1 = scan . next ( ) ; String b2 = scan . next ( ) ; int n = b1 . length ( ) ; int m = b2 . length ( ) ; if ( n != m ) System . out . print ( " NO " ) ; else { int b = 0 , e = n - 1 ; while ( b < n && e >= 0 ) { if ( b1 . charAt ( b ) != b2 . charAt ( e ) ) { System . out . println ( " NO " ) ; break ; } b ++ ; e -- ; } if ( b == n && e < 0 ) System . out . print ( " YES " ) ; } } }

import java . util . ArrayList ; import java . util . Scanner ; import java . math . * ;   public class CompProg {   public static void main ( String [ ] args ) { Scanner scan = new Scanner ( System . in ) ; String word1 = scan . next ( ) ; String word2 = scan . next ( ) ; boolean match = true ; if ( word1 . length ( ) != word2 . length ( ) ) match = false ; if ( match ) { for ( int i = 0 ; i < word1 . length ( ) ; i ++ ) { if ( word1 . charAt ( i ) != word2 . charAt ( word2 . length ( ) - 1 - i ) ) match = false ; } } if ( match ) System . out . println ( " YES " ) ; else System . out . println ( " NO " ) ; }   }

n = input ( ) m = input ( ) l1 = len ( n ) l2 = len ( m ) if l1 != l2 : print ( ' NO ' ) else : for i in range ( l1 ) : if n [ i ] != m [ l2 - 1 - i ] : print ( ' NO ' ) break else : print ( " YES " ) NEW_LINE

s1 = input ( ) [ : : - 1 ] s2 = input ( ) if s1 == s2 : print ( ' YES ' ) else : print ( ' NO ' ) NEW_LINE

t = str ( input ( ) ) s = str ( input ( ) ) z = 0 if len ( t ) == len ( s ) : for i in range ( 0 , len ( t ) ) : if t [ i ] == s [ len ( t ) - 1 - i ] : z += 1 if z == len ( t ) : print ( " YES " ) else : print ( " NO " ) NEW_LINE

s = input ( ) t = input ( ) t = t [ : : - 1 ] if ( s == t ) : print ( " YES " ) else : print ( " NO " ) NEW_LINE

str1 = input ( ) str2 = input ( )   new_s = str2 [ : : - 1 ]   if str1 == new_s : print ( " YES " ) else : print ( " NO " ) NEW_LINE


import java . util . * ; import java . io . * ;   public class Main254B { static int cal ( int month , int day ) { int [ ] months = { 0 , 31 , 28 , 31 , 30 , 31 , 30 , 31 , 31 , 30 , 31 , 30 , 31 } ; int res = 0 ; for ( int i = 1 ; i <= month - 1 ; i ++ ) res += months [ i ] ; return res + day ; } public static void main ( String [ ] args ) throws IOException { File in = new File ( " input . txt " ) ; Writer wr = new FileWriter ( " output . txt " ) ; Scanner sc = new Scanner ( in ) ; int n = sc . nextInt ( ) ; int [ ] marked = new int [ 2 * 365 + 1 ] ; for ( int i = 0 ; i < n ; i ++ ) { int m = sc . nextInt ( ) ; int d = sc . nextInt ( ) ; int p = sc . nextInt ( ) ; int t = sc . nextInt ( ) ; int x = cal ( m , d ) ; for ( int j = 1 ; j <= t ; j ++ ) { marked [ x - j + 365 ] += p ; } } int ans = 0 ; for ( int i = 0 ; i < marked . length ; i ++ ) { ans = Math . max ( marked [ i ] , ans ) ; } wr . write ( ans + " ▁ " ) ; wr . flush ( ) ; wr . close ( ) ; } }

import java . io . BufferedReader ; import java . io . File ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . util . * ; import java . util . concurrent . ConcurrentMap ;   public class Watermelon { static int [ ] month = { 0 , 31 , 28 , 31 , 30 , 31 , 30 , 31 , 31 , 30 , 31 , 30 , 31 } ; public static void main ( String [ ] args ) throws java . lang . Exception { Scanner sc = new Scanner ( new File ( " input . txt " ) ) ; PrintWriter pw = new PrintWriter ( " output . txt " ) ;

import java . io . BufferedReader ; import java . io . File ; import java . io . FileNotFoundException ; import java . io . FileReader ; import java . io . IOException ; import java . io . InputStreamReader ; import java . io . PrintWriter ; import java . time . LocalDate ; import java . util . HashMap ; import java . util . Map ; import java . util . StringTokenizer ;    public class Main {   public static void main ( String [ ] args ) throws IOException {   FastReader in = new FastReader ( new File ( " input . txt " ) ) ; PrintWriter out = new PrintWriter ( new File ( " output . txt " ) ) ;

def day ( m , d ) : days = 0 for i in range ( 1 , m ) : if i in [ 1 , 3 , 5 , 7 , 8 , 10 , 12 ] : days += 31 elif i == 2 : days += 28 else : days += 30 days += d + 100 return daysstdin = open ( ' input . txt ' , ' r ' ) f = open ( " output . txt " , ' w ' ) days = [ 0 ] * 565 n = int ( stdin . readline ( ) . strip ( ) ) for _ in range ( n ) : print ( " sdfds " ) m , d , p , t = map ( int , stdin . readline ( ) . split ( ) ) day_num = day ( m , d ) NEW_LINE

from datetime import date , timedeltaimport math     w = open ( ' output . txt ' , ' w ' ) r = open ( ' input . txt ' , ' r ' ) oplympiads = [ ]   min_date = date ( 2014 , 1 , 1 ) max_date = date ( 2011 , 1 , 1 )   n = int ( r . readline ( ) )   for _ in range ( n ) : m , d , p , t = map ( int , r . readline ( ) . split ( ) ) oplympiads . append ( ( m , d , p , t ) ) if ( date ( 2013 , m , d ) > max_date ) : max_date = date ( 2013 , m , d ) if ( date ( 2013 , m , d ) - timedelta ( t ) < min_date ) : min_date = date ( 2013 , m , d ) - timedelta ( t ) days_needed = ( max_date - min_date ) . daysnumber_of_workers_in_day = [ 0 ] * days_neededfor m , d , p , t in oplympiads : for dte in range ( t ) : number_of_workers_in_day [ ( ( date ( 2013 , m , d ) - timedelta ( t - dte ) ) - min_date ) . days ] += pw . write ( ' { } ' . format ( max ( number_of_workers_in_day ) ) ) NEW_LINE

import syssys . stdin = open ( ' input . txt ' , ' r ' ) sys . stdout = open ( ' output . txt ' , ' w ' )   di = { } k = 1 days = [ 31 , 28 , 31 , 30 , 31 , 30 , 31 , 31 , 30 , 31 , 30 , 31 ]   for i in range ( 12 ) : for j in range ( days [ i ] ) : di [ ( i + 1 , j + 1 ) ] = k k += 1   n = int ( input ( ) ) a = [ 0 ] * 512 for _ in range ( n ) : m , d , p , t = map ( int , input ( ) . split ( ) ) temp = di [ ( m , d ) ] for x in range ( temp - t , temp ) : a [ x ] += p   print ( max ( a ) ) NEW_LINE


import java . util . Scanner ; public class AA {   public static void main ( String [ ] args ) { int i , k = 0 , j = 0 , max = 0 ; Scanner obj = new Scanner ( System . in ) ;   int N = obj . nextInt ( ) ; int [ ] Liste = new int [ N ] ; for ( i = 0 ; i < N ; i ++ ) { Liste [ i ] = obj . nextInt ( ) ; if ( Liste [ i ] >= k ) { k = Liste [ i ] ; j ++ ; if ( max < j ) { max = j ; } } else { j = 1 ; k = Liste [ i ] ; } } System . out . println ( max ) ;   }   }

import java . util . * ; import java . lang . * ; import java . io . * ; public class Codechef {

import java . util . * ; import java . lang . * ; import java . io . * ; public class KefaAndFirstSteps { public static void main ( String args [ ] ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; BufferedWriter bw = new BufferedWriter ( new OutputStreamWriter ( System . out ) ) ; int n = Integer . parseInt ( br . readLine ( ) ) ; String arr [ ] = br . readLine ( ) . trim ( ) . split ( " \\ s + " ) ; int i = 0 , j = 1 ; if ( n == 1 ) { bw . write ( "1" ) ; } else { int max = Integer . MIN_VALUE ; int count = 1 ; for ( i = 0 ; i < n - 1 ; i ++ ) { int val1 = Integer . parseInt ( arr [ i ] ) ; int val2 = Integer . parseInt ( arr [ i + 1 ] ) ; if ( val1 <= val2 ) { count ++ ; } else { count = 1 ; } if ( count > max ) { max = count ; } } bw . write ( max + " \n " ) ; } bw . close ( ) ; } }

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

import java . util . Scanner ;    public class Main { public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int n = sc . nextInt ( ) ; int [ ] a = new int [ n ] ; int i , v , cnt1 = 1 , cnt2 = 0 ; for ( i = 0 ; i < n ; i ++ ) { v = sc . nextInt ( ) ; a [ i ] = v ; } for ( i = 1 ; i < n ; i ++ ) { if ( a [ i ] >= a [ i - 1 ] ) { cnt1 ++ ; } else { cnt2 = Math . max ( cnt1 , cnt2 ) ; cnt1 = 1 ; } } cnt2 = Math . max ( cnt1 , cnt2 ) ; System . out . println ( cnt2 ) ; } }

i = inputi ( ) c = m = l = 0 for n in i ( ) . split ( ) : n = int ( n ) c = c + 1 if n >= l else 1 m = max ( m , c ) l = nprint ( m ) NEW_LINE

n = int ( input ( ) ) subs = list ( map ( int , input ( ) . split ( ) ) ) memo = [ 0 , 1 ] + [ 0 ] * ( n - 1 ) max_subs = 1   for i in range ( 2 , n + 1 ) : current = subs [ i - 1 ] if current >= subs [ i - 2 ] : memo [ i ] = memo [ i - 1 ] + 1 max_subs = memo [ i ] if memo [ i ] > max_subs else max_subs else : if memo [ i - 1 ] > max_subs : max_subs = memo [ i - 1 ] memo [ i ] = 1 print ( max_subs ) NEW_LINE

def solve ( arr , n ) : max_val = 0 count = 1 for i in range ( n - 1 ) : if arr [ i + 1 ] >= arr [ i ] : count += 1 else : if count > max_val : max_val = count count = 1 return max ( max_val , count )                         def main ( ) : NEW_LINE

n = int ( input ( ) ) arr = list ( map ( int , input ( ) . split ( ) ) ) maxcount , count = 1 , 1 for i in range ( n - 1 ) : if arr [ i ] > arr [ i + 1 ] : count = 1 else : count += 1 if count > maxcount : maxcount = countprint ( maxcount ) NEW_LINE

n = int ( input ( ) ) x = [ int ( i ) for i in input ( ) . split ( ) ] counter = 1 maxcounter = 1 for i in range ( 1 , n ) : if x [ i ] >= x [ i - 1 ] : counter += 1 if counter > maxcounter : maxcounter = counter elif x [ i ] < x [ i - 1 ] : counter = 1 print ( maxcounter ) NEW_LINE


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

import java . util . * ; import java . io . * ; import java . math . BigInteger ; import java . text . * ; public class Main implements Runnable { static int mod = 1000_000_007 ; static long lim = ( long ) 1e9 + 6 ; static long mod1 = 998244353 ; static boolean fileIO = false ; static FastScanner f ; static int inf = 2000_000_000 ; static PrintWriter pw = new PrintWriter ( System . out ) ; static Scanner S = new Scanner ( System . in ) ; static long x0 ; static long y0 ; static long iinf = Long . MAX_VALUE ; static double eps = ( double ) 1e-6 ; public static void solve ( ) { int n = f . ni ( ) ; char s [ ] = f . next ( ) . toCharArray ( ) ;   int cnt = 0 ; boolean ok = true ; for ( int i = 0 ; i + 1 < s . length ; ++ i ) { if ( s [ i ] == ' ? ' ) { ++ cnt ; continue ; } ok &= s [ i ] != s [ i + 1 ] ; }   if ( ! ok ) { pn ( " No " ) ; return ; }   if ( s [ 0 ] == ' ? ' || s [ n - 1 ] == ' ? ' ) { pn ( " Yes " ) ; return ; }   for ( int i = 1 ; i + 1 < n ; ++ i ) { if ( s [ i ] == ' ? ' && s [ i - 1 ] == s [ i + 1 ] ) { pn ( " Yes " ) ; return ; } }   for ( int i = 0 ; i + 1 < n ; ++ i ) { if ( s [ i ] == ' ? ' && s [ i + 1 ] == ' ? ' ) { pn ( " Yes " ) ; return ; } }   pn ( " No " ) ; } public static void main ( String [ ] args ) throws IOException , InterruptedException { Thread thread = new Thread ( null , new Main ( ) , " F * uckit " , 1 << 28 ) ; thread . start ( ) ; thread . join ( ) ; } public void run ( ) { f = new FastScanner ( System . in ) ;

import java . util . Scanner ;   public class A957 {   public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int N = in . nextInt ( ) ; char [ ] S = in . next ( ) . toCharArray ( ) ; boolean noSolution = false ; boolean moreSolutions = S [ 0 ] == ' ? ' || S [ N - 1 ] == ' ? ' ; for ( int n = 1 ; n < N ; n ++ ) { if ( S [ n - 1 ] == S [ n ] ) { if ( S [ n ] == ' ? ' ) { moreSolutions = true ; } else { noSolution = true ; } } } for ( int n = 2 ; n < N ; n ++ ) { if ( S [ n - 2 ] == S [ n ] && S [ n - 1 ] == ' ? ' ) { moreSolutions = true ; } } boolean answer = ! noSolution && moreSolutions ; System . out . println ( answer ? " Yes " : " No " ) ; }   }

n = int ( input ( ) ) s = input ( ) s = s . split ( ' ? ' ) fl = 0 c = 0 for i in s : if len ( i ) == 0 : c = 1 for j in range ( 0 , len ( i ) - 1 ) : if i [ j ] == i [ j + 1 ] : fl = 1 break if fl == 1 : break   if fl : print ( ' No ' ) else : if c == 0 : for i in range ( 0 , len ( s ) - 1 ) : if s [ i ] [ len ( s [ i ] ) - 1 ] == s [ i + 1 ] [ 0 ] : c = 1 if c == 0 : print ( ' No ' ) else : print ( ' Yes ' ) else : print ( " Yes " ) NEW_LINE

n = int ( input ( ) ) s = input ( ) a = [ ' MM ' , ' YY ' , ' CC ' ] c = 1 for i in a : if ( i in s ) : c = 0 breakif ( c == 0 ) : print ( ' No ' ) elif ( s [ 0 ] == ' ? ' or s [ n - 1 ] == ' ? ' ) : print ( ' Yes ' ) else : if ( ' ? ? ' in s or ' Y ? Y ' in s or ' M ? M ' in s or ' C ? C ' in s ) : print ( ' Yes ' ) else : print ( ' No ' ) NEW_LINE

n = int ( input ( ) ) s = str ( input ( ) ) def get ( index ) : if index >= 0 and index < n : return s [ index ] return ' F ' output = " No " p = 0 while p < n : if s [ p ] == ' ? ' : sp = p + 1 length = 1 while sp < n : if s [ sp ] == ' ? ' : sp += 1 length += 1 else : break if get ( p - 1 ) == get ( sp ) or get ( p - 1 ) == ' F ' or get ( sp ) == ' F ' or length > 1 : output = " Yes " break p = sp else : p += 1 for j in range ( n - 1 ) : if s [ j ] != ' ? ' and s [ j + 1 ] != ' ? ' : if s [ j ] == s [ j + 1 ] : output = " No " breakprint ( output ) NEW_LINE

def check ( s ) : for i in range ( 1 , n ) : if s [ i ] == s [ i - 1 ] and s [ i ] != " ? " : return False return True   n = int ( input ( ) ) s = input ( ) if not check ( s ) : print ( " NO " ) exit ( )   ans = " NO " if s [ 0 ] == " ? " or s [ - 1 ] == " ? " : print ( " YES " ) exit ( ) for i in range ( n - 1 ) : if ( s [ i ] == " ? " and s [ i + 1 ] == " ? " ) or ( i > 0 and s [ i - 1 ] == s [ i + 1 ] and s [ i ] == " ? " ) : NEW_LINE

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


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

import java . util . * ;   public class Main { public static void main ( String [ ] args ) { Scanner in = new Scanner ( System . in ) ; int t = in . nextInt ( ) ;   while ( t -- > 0 ) { int n , m ; long ans ; n = in . nextInt ( ) ; m = in . nextInt ( ) ; ans = 0 ; int [ ] [ ] arr = new int [ n + 1 ] [ m + 2 ] ;   for ( int i = 0 ; i < n ; i ++ ) { String st = in . next ( ) ; for ( int j = 0 ; j < m ; j ++ ) { if ( st . charAt ( j ) == ' * ' ) arr [ i ] [ j + 1 ] = 1 ; } }   for ( int i = n ; i > 0 ; i -- ) { for ( int j = 1 ; j <= m ; j ++ ) { if ( arr [ i - 1 ] [ j ] > 0 ) { arr [ i - 1 ] [ j ] = 1 + Math . min ( arr [ i ] [ j + 1 ] , Math . min ( arr [ i ] [ j - 1 ] , arr [ i ] [ j ] ) ) ; ans += arr [ i - 1 ] [ j ] ; } } }   System . out . println ( ans ) ; } } }

import java . io . * ; import java . lang . * ; import java . util . * ; import java . io . * ; import java . util . * ; public class Main { static Scanner scanner = new Scanner ( System . in ) ; public static void main ( String [ ] args ) { int t = scanner . nextInt ( ) ; while ( t -- > 0 ) { int n = scanner . nextInt ( ) ; int m = scanner . nextInt ( ) ; char c [ ] [ ] = new char [ n ] [ m ] ; int [ ] [ ] a = new int [ n ] [ m ] ;

from sys import stdint = int ( input ( ) ) NEW_LINE for _ in range ( t ) : n , m = map ( int , stdin . readline ( ) . split ( ) ) NEW_LINE a = [ list ( stdin . readline ( ) ) for i in range ( n ) ] NEW_LINE cnt = 0 NEW_LINE dp = [ [ 0 ] * m for i in range ( n ) ] NEW_LINE for i in range ( n ) [ : : - 1 ] : for NEW_LINE j in range ( m ) : NEW_LINE if a [ i ] [ j ] == " * " : dp [ i ] [ j ] = 1 + ( min ( dp [ i + 1 ] [ j - 1 ] , dp [ i + 1 ] [ j ] , dp [ i + 1 ] [ j + 1 ] ) if not ( i == n - 1 or j == 0 or j == m - 1 ) else 0 ) NEW_LINE cnt += dp [ i ] [ j ] NEW_LINE print ( cnt ) NEW_LINE

import syst = int ( sys . stdin . readline ( ) ) NEW_LINE for _ in range ( t ) : r , c = map ( int , sys . stdin . readline ( ) . split ( ) ) NEW_LINE grid = [ [ 0 for i in range ( c + 2 ) ] ] + [ [ 0 ] for j in range ( r ) ] + [ [ 0 for i in range ( c + 2 ) ] ] NEW_LINE for i in range ( 1 , r + 1 ) : inp = sys . stdin . readline ( ) . strip ( ) NEW_LINE for j in range ( c ) : if NEW_LINE inp [ j ] == " * " : grid [ i ] . append ( 1 ) else : grid [ i ] . append ( 0 ) NEW_LINE grid [ i ] . append ( 0 ) NEW_LINE

for _ in range ( int ( input ( ) ) ) : n , m = map ( int , input ( ) . split ( ) ) NEW_LINE arr = [ list ( input ( ) ) for i in range ( n ) ] NEW_LINE dp = [ [ 0 ] * ( m + 2 ) for i in range ( n + 1 ) ] NEW_LINE ans = 0 NEW_LINE for i in range ( n - 1 , - 1 , - 1 ) : for NEW_LINE j in range ( 1 , m + 1 ) : NEW_LINE if arr [ i ] [ j - 1 ] == ' * ' : dp [ i ] [ j ] = 1 + min ( dp [ i + 1 ] [ j - 1 ] , dp [ i + 1 ] [ j ] , dp [ i + 1 ] [ j + 1 ] ) NEW_LINE ans += dp [ i ] [ j ] NEW_LINE print ( ans ) NEW_LINE

def solve ( ) : n , m = map ( int , input ( ) . split ( ) ) NEW_LINE a = [ ] NEW_LINE for i in range ( n ) : a . append ( input ( ) )   dp = [ ] NEW_LINE for i in range ( n ) : dp . append ( [ ] ) NEW_LINE for j in range ( m ) : dp [ i ] . append ( ( 1 if a [ i ] [ j ] == ' * ' else 0 ) if j == 0 else dp [ i ] [ j - 1 ] + ( 1 if a [ i ] [ j ] == ' * ' else 0 ) )   answer = 0 NEW_LINE for x in range ( n ) : for NEW_LINE y in range ( m ) : NEW_LINE if a [ x ] [ y ] == ' . ' : continue   for level in range ( min ( n - x , m - y , y + 1 ) ) : if NEW_LINE dp [ x + level ] [ y + level ] - ( 0 if y - level - 1 < 0 else dp [ x + level ] [ y - level - 1 ] ) != level * 2 + 1 : NEW_LINE break   answer += 1   print ( answer )     tests = int ( input ( ) )   while ( tests > 0 ) : solve ( ) NEW_LINE tests = tests - 1 NEW_LINE