/* * Code Author: Anamika Modi * DA-IICT */ import java.io.*; import java.math.BigInteger; import java.math.RoundingMode; import java.text.DecimalFormat; import java.util.*; public class code1 { static double eps=(double)1e-6; static long mod=(int)1e9+7; public static void main(String args[]){ InputReader in = new InputReader(System.in); OutputStream outputStream = System.out; PrintWriter out = new PrintWriter(outputStream); //----------My Code---------- int a[]=new int[26]; for(int i=0;i<26;i++){ a[i]=in.nextInt(); } String sp[]=in.nextLine().split(" "); int total=0; for(int i=0;i> arr,ArrayList a,int position1,int position2){ if(position1==position2){ arr.add(new ArrayList()); for(int i=0;i a,int p,int q){ // System.out.println(a.get(p)+" "+a.get(q)+"before swap"); int temp=a.get(p); a.set(p,a.get(q)); a.set(q,temp); // System.out.println(a.get(p)+" "+a.get(q)+"after swap"); } static int recursiveBinarySearch(int[][] sortedArray, int start, int end, int key) { if (start <= end) { int mid = start + (end - start) / 2; if (key < sortedArray[mid][0]) { return recursiveBinarySearch(sortedArray, start, mid, key); } else if (key > sortedArray[mid][0]) { return recursiveBinarySearch(sortedArray, mid+1, end , key); } else { return mid; } } return -(start + 1); } static long modulo(long a,long b,long c) { long x=1; long y=a; while(b > 0){ if(b%2 == 1){ x=(x*y)%c; } y = (y*y)%c; // squaring the base b /= 2; } return x%c; } static long gcd(long x, long y) { long r=0, a, b; a = (x > y) ? x : y; // a is greater number b = (x < y) ? x : y; // b is smaller number r = b; while(a % b != 0) { r = a % b; a = b; b = r; } return r; } static class Pair implements Comparable{ int x; int y; //int i; Pair(int xx,int yy){ x=xx; y=yy; //i=ii; } @Override public int compareTo(Pair o) { return Integer.compare(this.x,o.x); } } static class InputReader { public BufferedReader reader; public StringTokenizer tokenizer; public InputReader(InputStream inputstream) { reader = new BufferedReader(new InputStreamReader(inputstream)); tokenizer = null; } public String nextLine(){ String fullLine=null; while (tokenizer == null || !tokenizer.hasMoreTokens()) { try { fullLine=reader.readLine(); } catch (IOException e) { throw new RuntimeException(e); } return fullLine; } return fullLine; } 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 long nextLong() { return Long.parseLong(next()); } public int nextInt() { return Integer.parseInt(next()); } } }