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

public class GG {
    public static void main(String[] args) {
        FastScanner scanner = new FastScanner();
        PrintWriter out = new PrintWriter(System.out);
        int N = scanner.nextInt();
        int M = scanner.nextInt();
        int K = scanner.nextInt();
        int C = scanner.nextInt();
        int D = scanner.nextInt();
        MinCostMaxFlowSolver solver = new EdmondsKarp();
        int[] people = new int[K];
        for(int i = 0; i < K; i++) people[i] = scanner.nextInt()-1;
        Node src = solver.addNode();
        Node snk = solver.addNode();
        int amt = 500;
        Node[][] timeNodes = new Node[N][amt];
        for(int i = 0; i < N; i++) {
            for(int j = 1; j < amt; j++) {
                timeNodes[i][j] = solver.addNode();
                if (j > 1) solver.link(timeNodes[i][j-1], timeNodes[i][j], Integer.MAX_VALUE, 0);
            }
        }
        for(int i = 0; i < K; i++) {
            solver.link(src, timeNodes[people[i]][1], 1, 0);
        }
        for(int i = 1; i < amt; i++) {
            for(int j = 0; j < K; j++) {
                solver.link(timeNodes[0][i], snk, 1, C*i-C);
            }
        }
        for(int i =0; i < M; i++) {
            int a = scanner.nextInt()-1;
            int b = scanner.nextInt()-1;
            for(int j = 1; j < amt-1; j++) {
                for(int k = 1; k <= K; k++) {
                    solver.link(timeNodes[a][j], timeNodes[b][j + 1], k, D*k*k);
                    solver.link(timeNodes[b][j], timeNodes[a][j + 1], k, D*k*k);
                }
            }
        }
        long[] ret = solver.getMinCostMaxFlow(src, snk);
        out.println(ret[1]);
        out.flush();
    }

    public static class Node {
        // thou shall not create nodes except through addNode()
        private Node() { }

        List<Edge> edges = new ArrayList<Edge>();
        int index;          // index in nodes array

    }

    public static class Edge
    {
        boolean forward; // true: edge is in original graph
        Node from, to;   // nodes connected
        long flow;        // current flow
        final long capacity;
        Edge dual;      // reference to this edge's dual
        long cost;      // only used for MinCost.
        protected Edge(Node s, Node d, long c, boolean f)
        {
            forward = f;
            from = s;
            to = d;
            capacity = c;
        }
        long remaining() { return capacity - flow; }
        void addFlow(long amount) {
            flow += amount;
            dual.flow -= amount;
        }
    }

    public static abstract class MaxFlowSolver {
        List<Node> nodes = new ArrayList<Node>();

        public void link(Node n1, Node n2, long capacity) {
            link(n1, n2, capacity, 1);
        }

        public void link(Node n1, Node n2, long capacity, long cost) {
            Edge e12 = new Edge(n1, n2, capacity, true);
            Edge e21 = new Edge(n2, n1, 0, false);
            e12.dual = e21;
            e21.dual = e12;
            n1.edges.add(e12);
            n2.edges.add(e21);
            e12.cost = cost;
            e21.cost = -cost;
        }
        void link(int n1, int n2, long capacity) {
            link(nodes.get(n1), nodes.get(n2), capacity);
        }
        protected MaxFlowSolver(int n) {
            for (int i = 0; i < n; i++)
                addNode();
        }
        protected MaxFlowSolver() {
            this(0);
        }

        public abstract long getMaxFlow(Node src, Node snk);
        public Node addNode() {
            Node n = new Node();
            n.index = nodes.size();
            nodes.add(n);
            return n;
        }
    }
    static abstract class MinCostMaxFlowSolver extends MaxFlowSolver {
        // returns [maxflow, mincost]
        abstract long [] getMinCostMaxFlow(Node src, Node snk);
        // unavoidable boiler plate
        MinCostMaxFlowSolver ()      { this(0); }
        MinCostMaxFlowSolver (int n) { super(n); }
    }

    static class EdmondsKarp extends MinCostMaxFlowSolver
    {
        EdmondsKarp ()      { this(0); }
        EdmondsKarp (int n) { super(n); }
        long minCost;

        @Override
        public long [] getMinCostMaxFlow(Node src, Node snk) {
            long maxflow = getMaxFlow(src, snk);
            return new long [] { maxflow, minCost };
        }
        static final long INF = Long.MAX_VALUE/4;

        @Override
        public long getMaxFlow(Node src, Node snk) {
            final int n = nodes.size();
            final int source = src.index;
            final int sink = snk.index;
            long flow = 0;
            long cost = 0;
            long[] potential = new long[n]; // allows Dijkstra to work with negative edge weights
            while (true) {
                Edge[] parent = new Edge[n]; // used to store an augmenting path
                long[] dist = new long[n]; // minimal cost to vertex
                Arrays.fill(dist, INF);
                dist[source] = 0;
                PriorityQueue<Item> que = new PriorityQueue<Item>();
                que.add(new Item(0, source));
                while (!que.isEmpty()) {
                    Item item = que.poll();
                    if (item.dist != dist[item.v])
                        continue;

                    for (Edge e : nodes.get(item.v).edges) {
                        long temp = dist[item.v] + e.cost + potential[item.v] - potential[e.to.index];
                        if (e.capacity > e.flow && dist[e.to.index] > temp) {
                            dist[e.to.index] = temp;
                            parent[e.to.index] = e;
                            que.add(new Item(temp, e.to.index));
                        }
                    }
                }
                if (parent[sink] == null)
                    break;
                for (int i = 0; i < n; i++)
                    if (parent[i] != null)
                        potential[i] += dist[i];
                long augFlow = Long.MAX_VALUE;
                for (int i = sink; i != source; i = parent[i].from.index)
                    augFlow = Math.min(augFlow, parent[i].capacity - parent[i].flow);
                for (int i = sink; i != source; i = parent[i].from.index) {
                    Edge e = parent[i];
                    e.addFlow(augFlow);
                    cost += augFlow * e.cost;
                }
                flow += augFlow;
            }

            minCost = cost;
            return flow;
        }

        static class Item implements Comparable<Item> {
            long dist;
            int v;

            public Item(long dist, int v) {
                this.dist = dist;
                this.v = v;
            }

            public int compareTo(Item that) {
                return Long.compare(this.dist, that.dist);
            }
        }
    }

    public static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner(Reader in) {
            br = new BufferedReader(in);
        }

        public FastScanner() {
            this(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 readNextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        int[] readIntArray(int n) {
            int[] a = new int[n];
            for (int idx = 0; idx < n; idx++) {
                a[idx] = nextInt();
            }
            return a;
        }
    }
}


// upsolve with rainboy
import java.io.*;
import java.util.*;

public class CF1187G extends PrintWriter {
	CF1187G() { super(System.out); }
	static class Scanner {
		Scanner(InputStream in) { this.in = in; } InputStream in;
		int k, l; byte[] bb = new byte[1 << 15];
		byte getc() {
			if (k >= l) {
				k = 0;
				try { l = in.read(bb); } catch (IOException e) { l = 0; }
				if (l <= 0) return -1;
			}
			return bb[k++];
		}
		int nextInt() {
			byte c = 0; while (c <= 32) c = getc();
			int a = 0;
			while (c > 32) { a = a * 10 + c - '0'; c = getc(); }
			return a;
		}
	}
	Scanner sc = new Scanner(System.in);
	public static void main(String[] $) {
		CF1187G o = new CF1187G(); o.main(); o.flush();
	}

	static final int INF = 0x3f3f3f3f;
	ArrayList[] aa_;
	int n_, m_;
	int[] pi, kk;
	int[] uu, vv, uv, cost, cost_;
	int[] cc;
	void init() {
		aa_ = new ArrayList[n_];
		for (int u = 0; u < n_; u++)
			aa_[u] = new ArrayList<Integer>();
		pi = new int[n_];
		kk = new int[n_];
		uu = new int[m_];
		vv = new int[m_];
		uv = new int[m_];
		cost = new int[m_];
		cost_ = new int[m_];
		cc = new int[m_ * 2];
		m_ = 0;
	}
	void link(int u, int v, int cap, int cos) {
		int h = m_++;
		uu[h] = u;
		vv[h] = v;
		uv[h] = u ^ v;
		cost[h] = cos;
		cc[h << 1 ^ 0] = cap;
		aa_[u].add(h << 1 ^ 0);
		aa_[v].add(h << 1 ^ 1);
	}
	boolean dijkstra(int s, int t) {
		Arrays.fill(pi, INF);
		pi[s] = 0;
		TreeSet<Integer> pq = new TreeSet<>((u, v) -> pi[u] != pi[v] ? pi[u] - pi[v] : kk[u] != kk[v] ? kk[u] - kk[v] : u - v);
		pq.add(s);
		Integer first;
		while ((first = pq.pollFirst()) != null) {
			int u = first;
			int k = kk[u] + 1;
			ArrayList<Integer> adj = aa_[u];
			for (int h_ : adj)
				if (cc[h_] > 0) {
					int h = h_ >> 1;
					int p = pi[u] + ((h_ & 1) == 0 ? cost_[h] : -cost_[h]);
					int v = u ^ uv[h];
					if (pi[v] > p || pi[v] == p && kk[v] > k) {
						if (pi[v] != INF)
							pq.remove(v);
						pi[v] = p;
						kk[v] = k;
						pq.add(v);
					}
				}
		}
		return pi[t] != INF;
	}
	int dfs(int u, int t, int c) {
		if (u == t || c == 0)
			return c;
		int k = kk[u] + 1;
		ArrayList<Integer> adj = aa_[u];
		for (int h_ : adj) {
			int h = h_ >> 1;
			int p = pi[u] + ((h_ & 1) == 0 ? cost_[h] : -cost_[h]);
			int v = u ^ uv[h];
			int f;
			if (pi[v] == p && kk[v] == k && (f = dfs(v, t, Math.min(c, cc[h_]))) != 0) {
				cc[h_] -= f; cc[h_ ^ 1] += f;
				return f;
			}
		}
		return 0;
	}
	int edmonds_karp(int s, int t) {
		System.arraycopy(cost, 0, cost_, 0, m_);
		while (dijkstra(s, t)) {
			while (dfs(s, t, INF) > 0)
				;
			for (int h = 0; h < m_; h++) {
				int u = uu[h], v = vv[h];
				if (pi[u] != INF && pi[v] != INF)
					cost_[h] += pi[u] - pi[v];
			}
		}
		int c = 0;
		for (int h = 0; h < m_; h++)
			c += cost[h] * cc[h << 1 ^ 1];
		return c;
	}
	void main() {
		int n = sc.nextInt();
		int m = sc.nextInt();
		int k = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();
		int[] ii = new int[k];
		for (int h = 0; h < k; h++)
			ii[h] = sc.nextInt() - 1;
		ArrayList[] aa = new ArrayList[n];
		for (int i = 0; i < n; i++)
			aa[i] = new ArrayList<Integer>();
		for (int h = 0; h < m; h++) {
			int i = sc.nextInt() - 1;
			int j = sc.nextInt() - 1;
			aa[i].add(j);
			aa[j].add(i);
		}
		int t = n + k + 1;
		n_ = n * t + 1;
		m_ = k + (m * 2 * k + n) * (t - 1);
		init();
		for (int i = 0; i < n; i++) {
			ArrayList<Integer> adj = aa[i];
			for (int s = 0; s < t - 1; s++) {
				int u = i * t + s;
				for (int j : adj) {
					int v = j * t + s + 1;
					for (int x = 1; x <= k; x++)
						link(u, v, 1, c + (x * 2 - 1) * d);
				}
			}
		}
		for (int i = 0; i < n; i++)
			for (int s = 0; s < t - 1; s++) {
				int u = i * t + s, v = u + 1;
				link(u, v, k, i == 0 ? 0 : c);
			}
		for (int h = 0; h < k; h++)
			link(n_ - 1, ii[h] * t + 0, 1, 0);
		println(edmonds_karp(n_ - 1, 0 * t + t - 1));
	}
}


import java.util.Scanner;

public class Main
{
	public static void main(String[] args)
	{
		int num = 0;
		Scanner inp = new Scanner(System.in);
	while (true)
	{
		num = inp.nextInt();

		int[] xs = new int[num] ;
		int[] ys = new int[num] ;
		int var = 0;

		for(int i=0; i<num; ++i)
		{
			 var = inp.nextInt();
			 xs[i] = var;
			 var = inp.nextInt();
			 ys[i] = var;
		}

		boolean b = true ;
		if( (num == 1) || (num == 2 && xs[0] == xs[1]) || (num == 2 && ys[0] == ys[1] ) )
		{
			System.out.println(-1);
			b = false;
		}

		if(num == 2 && b == true)
		{
			int x = Math.max(xs[0],xs[1]) - Math.min(xs[0], xs[1]);
			int y = Math.max(ys[0], ys[1]) - Math.min(ys[0], ys[1]);
			int area = x * y;
			System.out.println(area);
		}

		boolean c = true;
		if(num == 3 && b == true)
		{
			for(int j=0; j<num; ++j)
			{
				for(int i=1; i<num; ++i)
				{
					if( (xs[j] != xs[i]) && (ys[j] != ys[i]) )
					{
						int x = Math.max(xs[j],xs[i]) - Math.min(xs[j], xs[i]);
						int y = Math.max(ys[j], ys[i]) - Math.min(ys[j], ys[i]);
						int area = x * y;
						System.out.println(area);
						c = false;
						break;
					}
				}
				if(c == false)
					break;
			}
		}

		boolean c2 = true;
		if(num == 4 && b == true)
		{
			for(int j=0; j<num; ++j)
			{
				for(int i=1; i<num; ++i)
				{
					if( (xs[j] != xs[i]) && (ys[j] != ys[i]) )
					{
						int x = Math.max(xs[j],xs[i]) - Math.min(xs[j], xs[i]);
						int y = Math.max(ys[j], ys[i]) - Math.min(ys[j], ys[i]);
						int area = x * y;
						System.out.println(area);
						c2 = false;
						break;
					}
				}
				if(c2 == false)
					break;
			}
		}
	}
	}
}


import java.util.*;

public class Bus {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		long endPoint = in.nextInt();
		long fuelCap = in.nextInt();
		long gasPoint = in.nextInt();
		long trips = in.nextInt();

		long total = endPoint * trips;

		long pos = 0;
		long direction = 1;
		long curFuel = fuelCap;
		long completed = 0;
		long res = 0;

		while (completed < trips) {
			// System.out.println("pos: " + pos + "," + "curFuel: " + curFuel + "," + "completed: " + completed + "," + "res: " + res);
			long distanceToNextCheckpoint = -1;
			long distanceToNextGas = -1;

			if (direction == 1) {
				distanceToNextCheckpoint = Math.abs(pos - endPoint);
				distanceToNextGas = Math.abs(pos - gasPoint);
			}
			else {
				distanceToNextCheckpoint = Math.abs(pos - 0);
				distanceToNextGas = Math.abs(pos - gasPoint);
			}

			// System.out.println("distanceToNextCheckpoint: " + distanceToNextCheckpoint + "," + "distanceToNextGas: " + distanceToNextGas);

			if (curFuel < distanceToNextCheckpoint && curFuel < distanceToNextGas) {
				res = -1;
				break;
			}

			if (pos == endPoint) {
				direction = -1;
				completed++;
				if (completed == trips) break;
			}
			if (pos == 0 && completed > 0) {
				direction = 1;
				completed++;
				if (completed == trips) break;
			}

			if (pos == gasPoint) {
				if (direction == 1) distanceToNextGas = distanceToNextCheckpoint + Math.abs(endPoint - gasPoint);
				else distanceToNextGas = distanceToNextCheckpoint + Math.abs(0 - gasPoint);

				// System.out.println("GAS POINT");
				// System.out.println("distanceToNextCheckpoint: " + distanceToNextCheckpoint + "," + "distanceToNextGas: " + distanceToNextGas);

				if (curFuel < distanceToNextCheckpoint && trips - completed == 1) {
					res++;
					curFuel = fuelCap;
				}
				if (curFuel < distanceToNextGas && trips - completed > 1) {
					res++;
					curFuel = fuelCap;
				}
			}

			pos += direction;
			curFuel--;
		}

		System.out.println(res);
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Collection;
import java.util.Locale;
import java.util.StringTokenizer;

public class Main {
	public static void main(String[] args) throws IOException {
		new Thread(null, new Runnable() {
			public void run() {
				try {
					long prevTime = System.currentTimeMillis();
					new Main().run();
					System.err.println("Total time: "
							+ (System.currentTimeMillis() - prevTime) + " ms");
					System.err.println("Memory status: " + memoryStatus());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		}, "1", 1L << 24).start();
	}

	void run() throws IOException {
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		Object o = solve();
		if (o != null)
			out.println(o);
		out.close();
		in.close();
	}

	private Object solve() throws IOException {
		int a = ni();
		short b = (short) ni();
		short w = (short) ni();
		short x = (short) ni();
		int c = ni();

		int step = 100000;

		short[][] move_b = new short[w][step + 1];
		for (short i = 0; i < w; i++)
			move_b[i][0] = i;
		int[][] dif_b = new int[w][step + 1];
		for (int i = 0; i < w; i++)
			dif_b[i][0] = 0;

		for (int move = 1; move <= step; move++)
			for (int bb = 0; bb < w; bb++) {
				short prev_b = move_b[bb][move - 1];
				int prev_dif = dif_b[bb][move - 1];

				if (prev_b >= x) {
					move_b[bb][move] = (short) (prev_b - x);
					dif_b[bb][move] = prev_dif;
				} else {
					move_b[bb][move] = (short) (w - (x - prev_b));
					dif_b[bb][move] = prev_dif + 1;
				}

			}
		long t = 0;
		while (has_next(a, b, c, dif_b, step)) {
			a -= dif_b[b][step];
			b = move_b[b][step];
			t += (long) (step);
			c -= (long) (step);

		}
		while (c > a) {
			c--;
			a -= (long) (dif_b[b][1]);
			b = move_b[b][1];
			t++;
		}

		return t;
	}

	private boolean has_next(int a, short b, int c, int[][] dif_b, int step) {
		int next_c = c - step;
		int next_a = a - dif_b[b][step];
		return next_c > next_a;
	}

	BufferedReader in;
	PrintWriter out;
	StringTokenizer st = new StringTokenizer("");

	String nextToken() throws IOException {
		while (!st.hasMoreTokens())
			st = new StringTokenizer(in.readLine());
		return st.nextToken();
	}

	int ni() throws IOException {
		return Integer.parseInt(nextToken());
	}

	long nl() throws IOException {
		return Long.parseLong(nextToken());
	}

	double nd() throws IOException {
		return Double.parseDouble(nextToken());
	}

	int[] nia(int size) throws IOException {
		int[] ret = new int[size];
		for (int i = 0; i < size; i++)
			ret[i] = ni();
		return ret;
	}

	long[] nla(int size) throws IOException {
		long[] ret = new long[size];
		for (int i = 0; i < size; i++)
			ret[i] = nl();
		return ret;
	}

	double[] nda(int size) throws IOException {
		double[] ret = new double[size];
		for (int i = 0; i < size; i++)
			ret[i] = nd();
		return ret;
	}

	String nextLine() throws IOException {
		st = new StringTokenizer("");
		return in.readLine();
	}

	boolean EOF() throws IOException {
		while (!st.hasMoreTokens()) {
			String s = in.readLine();
			if (s == null)
				return true;
			st = new StringTokenizer(s);
		}
		return false;
	}

	void printRepeat(String s, int count) {
		for (int i = 0; i < count; i++)
			out.print(s);
	}

	void printArray(int[] array) {
		for (int i = 0; i < array.length; i++) {
			if (i > 0)
				out.print(' ');
			out.print(array[i]);
		}
		out.println();
	}

	void printArray(long[] array) {
		for (int i = 0; i < array.length; i++) {
			if (i > 0)
				out.print(' ');
			out.print(array[i]);
		}
		out.println();
	}

	void printArray(double[] array) {
		for (int i = 0; i < array.length; i++) {
			if (i > 0)
				out.print(' ');
			out.print(array[i]);
		}
		out.println();
	}

	void printArray(double[] array, String spec) {
		for (int i = 0; i < array.length; i++) {
			if (i > 0)
				out.print(' ');
			out.printf(Locale.US, spec, array[i]);
		}
		out.println();
	}

	void printArray(Object[] array) {
		boolean blank = false;
		for (Object x : array) {
			if (blank)
				out.print(' ');
			else
				blank = true;
			out.print(x);
		}
		out.println();
	}

	@SuppressWarnings("rawtypes")
	void printCollection(Collection collection) {
		boolean blank = false;
		for (Object x : collection) {
			if (blank)
				out.print(' ');
			else
				blank = true;
			out.print(x);
		}
		out.println();
	}

	static String memoryStatus() {
		return (Runtime.getRuntime().totalMemory()
				- Runtime.getRuntime().freeMemory() >> 20)
				+ "/" + (Runtime.getRuntime().totalMemory() >> 20) + " MB";
	}
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
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);
        B770 solver = new B770();
        solver.solve(1, in, out);
        out.close();
    }

    static class B770 {
        int score(char[] cc) {
            int s = 0;
            for (char c : cc)
                s += c - '0';
            return s;
        }

        public void solve(int testNumber, FastScanner s, PrintWriter out) {
            char[] num = s.next().toCharArray();
            int cur = Integer.parseInt(new String(num));
            int best = score(num);
            for (int i = num.length - 1; i >= 0; i--) {
                if (num[i] == '0') continue;
                char[] test = num.clone();
                test[i]--;
                for (int j = i + 1; j < num.length; j++)
                    test[j] = '9';
                if (score(test) > best) {
                    cur = Integer.parseInt(new String(test));
                    best = score(test);
                }
            }

            out.println(cur);
        }

    }

    static class FastScanner {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;

        public FastScanner(InputStream stream) {
            this.stream = stream;
        }

        int read() {
            if (numChars == -1)
                throw new InputMismatchException();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public String next() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

    }
}


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

public class CodeForce_250A {

    public static void main(String[] args) throws IOException {

        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        String a = in.readLine();
        String b = in.readLine();
        String c = in.readLine();
        String d = in.readLine();
        int aLen = a.length()-2;
        int bLen = b.length()-2;
        int cLen = c.length()-2;
        int dLen = d.length()-2;
        System.out.println(getResult(aLen, bLen, cLen, dLen));

    }

    private static String getResult(int a, int b, int c, int d) {
        if((a>=2*b&&a>=2*c&&a>=2*d)||(2*a<=b&&2*a<=c&&2*a<=d)){
            return "A";
        }
        if((b>=2*a&&b>=2*c&&b>=2*d)||(2*b<=a&&2*b<=c&&2*b<=d)){
            return "B";
        }

        if((c>=2*a&&c>=2*b&&c>=2*d)||(2*c<=a&&2*c<=b&&2*c<=d)){
            return "C";
        }

        if((d>=2*a&&d>=2*b&&d>=2*c)||(2*d<=a&&2*d<=b&&2*d<=c)){
            return "D";
        }

        return "C";
    }

}


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

public class Main{

    BufferedReader in;
    StringTokenizer str = null;
    PrintWriter out;

    private String next() throws Exception{
    	if (str == null || !str.hasMoreElements())
    	    str = new StringTokenizer(in.readLine());
    	return str.nextToken();
    }

    private int nextInt() throws Exception{
	return Integer.parseInt(next());
    }

    private long nextLong() throws Exception{
	return Long.parseLong(next());
    }

    int n, e;
    long V;

    int [][]g;
    long []a, b, amount;
    boolean used[];

    long total = 0;
    int size = 0, yk = 0;
    int []comp, prev;

    int []from, to;
    public void run() throws Exception{
    	in = new BufferedReader(new InputStreamReader(System.in));
    	out = new PrintWriter(System.out);

	n = nextInt();
	V = nextLong();
	e = nextInt();

	a = new long[n];
	for(int i=0;i<n;i++){
	    a[i] = nextLong();
	}
	b = new long[n];
	for(int i=0;i<n;i++){
	    b[i] = nextLong();
	}

	from = new int[2*n*n];
	to = new int[2*n*n];
	amount = new long[2*n*n];

	g = new int[n][n];
	for(int i=0;i<e;i++){
	    int x = nextInt()-1, y = nextInt()-1;
	    g[x][y] = g[y][x] = 1;
	}

	comp = new int[n];
	prev = new int[n];
	Arrays.fill(prev, -1);
	used = new boolean[n];
	boolean ok  =true;

	for(int i=0;i<n;i++){
	    if (!used[i]){
		size = 0;
		total = 0;
		dfs(i);
		if (total != 0){
		    ok = false;
		    break;
		}

		for(int j=0;j<size;j++){
		    int v = comp[j];
		    if (a[v] <= b[v]) continue;
		    parents(v);
		    int u = -1;
		    for(int k=0;k<size;k++){
			int t = comp[k];
			if (a[t] < b[t]){
			    u = t;
			    break;
			}
		    }
		    long d = Math.min(a[v] - b[v], b[u] - a[u]);
		    pour(v, u, d);
		}
	    }
	}

	if (!ok){
	    out.println("NO");
	}else{
	    out.println(yk);
	    for(int i=0;i<yk;i++){
		out.println(from[i] + " " + to[i] + " " + amount[i]);
	    }
	}
	out.close();
    }

    private void pour(int s, int t, long d){
	if (s == t) return;
	int parent = prev[t];

	long x = Math.min(d, a[parent]);
	add(parent, t, x);
	pour(s, parent, d);
	add(parent, t, d-x);
    }

    private void add(int s, int t, long d){
	if (d == 0) return;
	from[yk] = s+1;
	to[yk] = t+1;
	amount[yk++] = d;
	a[s]-=d;
	a[t]+=d;
    }

    private void parents(int x){
	for(int i=0;i<n;i++){
	    if (prev[i] < 0 && g[x][i] == 1) {
		prev[i] = x;
		parents(i);
	    }
	}
    }

    private void dfs(int x){
	used[x] = true;
	total+=a[x] - b[x];

	for(int i=0;i<n;i++){
	    if (!used[i] && g[x][i] == 1){
		dfs(i);
	    }
	}
	comp[size++] = x;
    }

    public static void main(String args[]) throws Exception{
	   new Main().run();
    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
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);
        BThreeLevelLaser solver = new BThreeLevelLaser();
        solver.solve(1, in, out);
        out.close();
    }

    static class BThreeLevelLaser {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int U = in.nextInt();
            double[] E = in.nextDoubleArray(n);

            double ans = -1;
            for (int i = 0; i < n; i++) {
                int j = i + 1;
                int l = i + 1;
                int r = n;
                while (r - l > 1) {
                    int mid = (l + r) / 2;
                    if ((E[mid] - E[i]) <= U) {
                        l = mid;
                    } else {
                        r = mid;
                    }
                }
                int k = l;
                if (k != i + 1) {
                    ans = Math.max(ans, (E[k] - E[j]) / (E[k] - E[i]));
                }
            }
            if (ans == -1) out.println(-1);
            else out.println(ans);

        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1)
                throw new InputMismatchException();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        private boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public double nextDouble() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            double res = 0;
            while (!isSpaceChar(c) && c != '.') {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, nextInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            if (c == '.') {
                c = read();
                double m = 1;
                while (!isSpaceChar(c)) {
                    if (c == 'e' || c == 'E')
                        return res * Math.pow(10, nextInt());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    m /= 10;
                    res += (c - '0') * m;
                    c = read();
                }
            }
            return res * sgn;
        }

        public double[] nextDoubleArray(int size) {
            double[] array = new double[size];
            for (int i = 0; i < size; i++)
                array[i] = nextDouble();
            return array;
        }

    }
}


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

public class CF515A {
	public static void main(String[] args) throws IOException {
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(bf.readLine());
		int a = Integer.parseInt(st.nextToken());
		int b = Integer.parseInt(st.nextToken());
		int s = Integer.parseInt(st.nextToken());

		if (s < a+b){
			System.out.println("No");
		}
		else if ((s-(a+b)) % 2 == 0){
			System.out.println("Yes");
		}
		else{
			System.out.println("No");
		}
	}
}


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

public class E {

	static final int[] DX = { -1, 0, 1, 0 };
	static final int[] DY = { 0, -1, 0, 1 };

	static final int P = 1_000_000_007;

	static final int CACHE_SIZE = 1 << 19;
	int[] cacheInv = new int[CACHE_SIZE];
	{
		cacheInv[1] = 1;
		for (int i = 2; i < CACHE_SIZE; i++) {
			cacheInv[i] = P - (int) ((long) (P / i) * cacheInv[P % i] % P);
		}
	}

	int inv(int x) {
		return x < CACHE_SIZE ? cacheInv[x] : P
				- (int) ((long) (P / x) * inv(P % x) % P);
	}

	void submit() {
		// long start = System.currentTimeMillis();
		int r = nextInt();
		int[] byDir = new int[4];
		int sum = 0;
		for (int i = 0; i < 4; i++) {
			byDir[i] = nextInt();
			sum += byDir[i];
		}

		int invSum = inv(sum);

		for (int i = 0; i < 4; i++) {
			byDir[i] = (int) ((long) byDir[i] * invSum % P);
		}

		int s = 2 * r + 3;

		int[][] f = new int[s][s];
		int[] cx = new int[s * s];
		int[] cy = new int[s * s];
		int vars = 0;
		for (int i = 0; i < s; i++) {
			for (int j = 0; j < s; j++) {
				int sum2 = (i - r - 1) * (i - r - 1) + (j - r - 1)
						* (j - r - 1);
				if (sum2 <= r * r) {
					cx[vars] = i;
					cy[vars] = j;
					f[i][j] = vars++;
				} else {
					f[i][j] = -1;
				}
			}
		}

		int band = 0;

		for (int i = 0; i < vars; i++) {
			int x0 = cx[i];
			int y0 = cy[i];
			for (int dir = 0; dir < 4; dir++) {
				int x1 = x0 + DX[dir];
				int y1 = y0 + DY[dir];
				if (f[x1][y1] == -1) {
					continue;
				}
				int j = f[x1][y1];
				band = Math.max(band, Math.abs(i - j));
			}
		}

		int[][] bandM = new int[vars][2 * band + 1];

		for (int i = 0; i < vars; i++) {
			int x0 = cx[i];
			int y0 = cy[i];
			for (int dir = 0; dir < 4; dir++) {
				int x1 = x0 + DX[dir];
				int y1 = y0 + DY[dir];
				if (f[x1][y1] == -1) {
					continue;
				}
				int j = f[x1][y1];

				updateBandedMatrix(i, j, band, bandM, byDir[dir]);

			}
		}

		for (int i = 0; i < vars; i++) {
			for (int d = 0; d <= 2 * band; d++) {
				int j = i + d - band;
				bandM[i][d] = (i == j ? 1 : 0) - bandM[i][d];
				if (bandM[i][d] < 0) {
					bandM[i][d] += P;
				}
			}
		}

		// out.println(System.currentTimeMillis() - start);

		int[] ans = inverseBanded(bandM, band, f[r + 1][r + 1]);

		// out.println(System.currentTimeMillis() - start);

		int ret = 0;
		for (int x : ans) {
			ret += x;
			if (ret >= P) {
				ret -= P;
			}
		}

		out.println(ret);

	}

	void updateBandedMatrix(int row, int col, int width, int[][] m, double delta) {
		if (Math.abs(row - col) > width) {
			throw new AssertionError();
		}
		m[row][col - row + width] += delta;
	}

	int[] inverseBanded(int[][] a, int w, int whatCol) {
		int n = a.length;
		if (whatCol > n) {
			throw new AssertionError();
		}
		int[] b = new int[n];
		b[whatCol] = 1;

		for (int j = 0; j < n; j++) {
			int[] aj = a[j];
			for (int i = j + 1; i <= j + w && i < n; i++) {
				int[] ai = a[i];
				int coef = (int) ((long) ai[j - i + w] * inv(aj[w]) % P);

				int kUpTo = Math.min(n, j + w + 1);

				for (int k = j + 1; k < kUpTo; k++) {
					int kek = ai[k - i + w]
							- (int) ((long) aj[k - j + w] * coef % P);
					if (kek < 0) {
						kek += P;
					}
					ai[k - i + w] = kek;
				}
				b[i] -= (int) ((long) b[j] * coef % P);
				if (b[i] < 0) {
					b[i] += P;
				}
			}
		}

		// for (int i = n - 1; i >= 0; i--) {
		// for (int j = i + 1; j < n && j <= i + w; j++) {
		// b[i] -= (int) ((long) b[j] * a[i][j - i + w] % P);
		// if (b[i] < 0) {
		// b[i] += P;
		// }
		// }
		// b[i] = (int) ((long) b[i] * inv(a[i][w]) % P);
		// }

		for (int i = n - 1; i >= 0; i--) {
			long tot = 0;
			for (int j = i + 1; j < n && j <= i + w; j++) {
				tot += (long) b[j] * a[i][j - i + w];
				if (tot >= P2) {
					tot -= P2;
				}
			}
			b[i] -= (int) (tot % P);
			if (b[i] < 0) {
				b[i] += P;
			}
			b[i] = (int) ((long) b[i] * inv(a[i][w]) % P);
		}

		return b;
	}

	static final long P2 = (long) P * P;

	void preCalc() {

	}

	void test() {

	}

	void stress() {
		for (int tst = 0;; tst++) {
			if (false) {
				throw new AssertionError();
			}
			System.err.println(tst);
		}
	}

	E() throws IOException {
		is = System.in;
		out = new PrintWriter(System.out);
		preCalc();
		submit();
		// stress();
		// test();
		out.close();
	}

	static final Random rng = new Random();
	static final int C = 5;

	static int rand(int l, int r) {
		return l + rng.nextInt(r - l + 1);
	}

	public static void main(String[] args) throws IOException {
		new E();
	}

	private InputStream is;
	PrintWriter out;

	private byte[] buf = new byte[1 << 14];
	private int bufSz = 0, bufPtr = 0;

	private int readByte() {
		if (bufSz == -1)
			throw new RuntimeException("Reading past EOF");
		if (bufPtr >= bufSz) {
			bufPtr = 0;
			try {
				bufSz = is.read(buf);
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
			if (bufSz <= 0)
				return -1;
		}
		return buf[bufPtr++];
	}

	private boolean isTrash(int c) {
		return c < 33 || c > 126;
	}

	private int skip() {
		int b;
		while ((b = readByte()) != -1 && isTrash(b))
			;
		return b;
	}

	String nextToken() {
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while (!isTrash(b)) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	String nextString() {
		int b = readByte();
		StringBuilder sb = new StringBuilder();
		while (!isTrash(b) || b == ' ') {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	double nextDouble() {
		return Double.parseDouble(nextToken());
	}

	char nextChar() {
		return (char) skip();
	}

	int nextInt() {
		int ret = 0;
		int b = skip();
		if (b != '-' && (b < '0' || b > '9')) {
			throw new InputMismatchException();
		}
		boolean neg = false;
		if (b == '-') {
			neg = true;
			b = readByte();
		}
		while (true) {
			if (b >= '0' && b <= '9') {
				ret = ret * 10 + (b - '0');
			} else {
				if (b != -1 && !isTrash(b)) {
					throw new InputMismatchException();
				}
				return neg ? -ret : ret;
			}
			b = readByte();
		}
	}

	long nextLong() {
		long ret = 0;
		int b = skip();
		if (b != '-' && (b < '0' || b > '9')) {
			throw new InputMismatchException();
		}
		boolean neg = false;
		if (b == '-') {
			neg = true;
			b = readByte();
		}
		while (true) {
			if (b >= '0' && b <= '9') {
				ret = ret * 10 + (b - '0');
			} else {
				if (b != -1 && !isTrash(b)) {
					throw new InputMismatchException();
				}
				return neg ? -ret : ret;
			}
			b = readByte();
		}
	}
}


import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        int n,pos,l,r,i;
        n=scan.nextInt();
        pos=scan.nextInt();
        l=scan.nextInt();
        r=scan.nextInt();
        if(n==r && l==1){
            System.out.println(0);
        }
        else if(pos==r && l==1){
            System.out.println(1);
        }
        else{
            i=0;
            if(l==1 && pos!=r){
                if(pos>r){
                    System.out.println((pos-r)+1);
                }else{
                System.out.println(n-pos);
                }
            }else{
                if(n==r){
                   while(pos!=l){
                pos--;
                i++;
            }
                    System.out.println(i+1);
                }else{
            while(pos!=l){
                pos--;
                i++;
            }
            while(pos!=n){
                pos++;
                i++;
            }
            System.out.println(i);
        }
            }
        }

    }
}


package com.example.programming;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Queue;
import java.util.Scanner;

public class CodeforcesProblems {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        //String[] s = br.readLine().split(" ");
        int n = Integer.parseInt(br.readLine());
        String actg = "ACTG";

        String str = br.readLine();
        int min = 5656;
        for(int i = 0; i<n-3; i++) {
            int te = 0;
            for(int j = 0; j<4; j++) {
                int ch1 = str.charAt(i+j);
                int ch2 = actg.charAt(j);
                int x = Math.min(ch1, ch2);
                int y = Math.max(ch1, ch2);
                int f = y-x;
                int s = x-y+26;
                int diff = Math.min(f,s);
                te += diff;
            }
            if(te<min) min = te;
        }
        System.out.println(min);
    }
}


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package main;
import java.util.*;
import java.io.*;
import java.text.*;
/**
 *
 * @author alanl
 */
public class Main{
    static BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
    static StringTokenizer st;
    static PrintWriter pr = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
    public static void main(String[] args) throws IOException{
        int n = readInt(), ans = Integer.MAX_VALUE;
        String s = readLine();
        Queue<edge>Q = new LinkedList();
        Q.add(new edge(String.valueOf(s.charAt(0)), 1, false));
        while(!Q.isEmpty()){
            edge cur = Q.poll();
            if(cur.s.equals(s)){
                System.out.println(cur.v);
                break;
            }
            else if(cur.s.length()>=n)continue;
            Q.add(new edge(cur.s+s.charAt(cur.s.length()), cur.v+1, cur.c));
            if(!cur.c){
                Q.add(new edge(cur.s+cur.s, cur.v+1, true));
            }
        }
        //System.out.println(ans);
    }
    static class edge{
        String s;
        int v;
        boolean c;
        edge(String s0, int v0, boolean c0){
            s = s0;
            v = v0;
            c = c0;
        }
    }
    static String next () throws IOException {
        while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(input.readLine().trim());
        return st.nextToken();
    }
    static long readLong () throws IOException {
        return Long.parseLong(next());
    }
    static int readInt () throws IOException {
        return Integer.parseInt(next());
    }
    static double readDouble () throws IOException {
        return Double.parseDouble(next());
    }
    static char readChar () throws IOException {
        return next().charAt(0);
    }
    static String readLine () throws IOException {
        return input.readLine().trim();
    }
}


import java.util.*;

public class KRounding {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        long c = (long) Math.pow(10, k);
        long a = 2;
        int b = 2;
        int e = 5;
        String s = String.valueOf(n);
        int p = s.charAt(s.length() - 1) - '0';
        if (p == 9) {
            a = n * c;
        } else {
            for (long i = n; i <= c * n;) {
                if (i % n == 0 && i % c == 0) {
                    a = i;
                    break;
                }
                if ((n * e) % n == 0 && (n * e) % c == 0) {
                    a = n * e;
                    break;
                }
                i = n * b;
                b = b + 2;
                e = e + 5;
            }
        }
        System.out.println(a);
    }
}


import java.util.*;
import java.awt.*;

public class seabattle {
	static int map [][];
	static int n;
	static int m;
	static int dx[] = {0,0,1,-1,1,-1,1,-1};
	static int dy[] = {1,-1,0,0,-1,1,1,-1};
	static int count = 0;
	private static void DFS(Point pt) {
		for(int i = 0; i < 8; i++) {
			if(map[pt.y+dy[i]][pt.x+dx[i]] == 0) {
				map[pt.y+dy[i]][pt.x+dx[i]] = 2;
				count++;
			}else if(map[pt.y+dy[i]][pt.x+dx[i]] == 1) {
				map[pt.y][pt.x] = 3;
				DFS(new Point(pt.x+dx[i],pt.y+dy[i]));
				}
		}
	}
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int w1 = in.nextInt(), h1 = in.nextInt(), w2 = in.nextInt(), h2 = in.nextInt();
		n = h1+h2+2;
		m = Math.max(w1, w2)+2;
		map = new int[n][m];
		for(int i = 1; i <= h1+h2; i++) {
			for(int j = 1; j <= Math.max(w1, w2); j++) {
				if((i<=h1 && j <= w1) || (i > h1 && i <= h1+h2 && j <= w2)) {
					map[i][j] = 1;
				}
			}
		}
		DFS(new Point(1,1));
		System.out.println(count);
		in.close();
	}
}


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

public class Prob1131A {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] temp = br.readLine().split(" ");
        int w1 = Integer.parseInt(temp[0]);
        int h1 = Integer.parseInt(temp[1]);
        int w2 = Integer.parseInt(temp[2]);
        int h2 = Integer.parseInt(temp[3]);
        int[][] bot = new int[w1][h1];
        int[][] top = new int[w2][h2];
        int[] sq = new int[h2 + h1 + 2];
        for(int i = 1; i <= h1 + h2; i++)
        {
            if(i <= h2)
            {
                sq[i] = w2 + 2;
            }
            else
            {
                sq[i] = w1 + 2;
            }
        }
        sq[0] = w2 + 2;
        sq[sq.length - 1] = w1 + 2;
        int sum = (w1 - w2);
        for(int i = 0; i < sq.length; i++)
        {
            sum += sq[i];
        }
        System.out.println(sum - (w1 * h1) - (w2 * h2));

    }
}


// practice with rainboy
import java.io.*;
import java.util.*;

public class CF273D extends PrintWriter {
	CF273D() { super(System.out, true); }
	Scanner sc = new Scanner(System.in);
	public static void main(String[] $) {
		CF273D o = new CF273D(); o.main(); o.flush();
	}

	static final int MD = 1000000007;
	int query(int[][] aa, int l0, int l1, int r0, int r1) {
		return l0 > l1 || r0 > r1 ? 0 : (int) ((long) aa[l1][r1] - aa[l0 - 1][r1] - aa[l1][r0 - 1] + aa[l0 - 1][r0 - 1]) % MD;
	}
	void add(int[][] aa, int l, int r, int a) {
		aa[l][r] = (aa[l][r] + a) % MD;
	}
	void main() {
		int n = sc.nextInt();
		int m = sc.nextInt();
		int[][] dp00 = new int[m + 1][m + 1];
		int[][] dp01 = new int[m + 1][m + 1];
		int[][] dp10 = new int[m + 1][m + 1];
		int[][] dp11 = new int[m + 1][m + 1];
		int[][] dq00 = new int[m + 1][m + 1];
		int[][] dq01 = new int[m + 1][m + 1];
		int[][] dq10 = new int[m + 1][m + 1];
		int[][] dq11 = new int[m + 1][m + 1];
		long ans = 0;
		while (n-- > 0) {
			for (int l = 1; l <= m; l++)
				for (int r = 1; r <= m; r++) {
					dp00[l][r] = (dp00[l][r] + dp00[l][r - 1]) % MD;
					dp01[l][r] = (dp01[l][r] + dp01[l][r - 1]) % MD;
					dp10[l][r] = (dp10[l][r] + dp10[l][r - 1]) % MD;
					dp11[l][r] = (dp11[l][r] + dp11[l][r - 1]) % MD;
				}
			for (int l = 1; l <= m; l++)
				for (int r = 1; r <= m; r++) {
					dp00[l][r] = (dp00[l][r] + dp00[l - 1][r]) % MD;
					dp01[l][r] = (dp01[l][r] + dp01[l - 1][r]) % MD;
					dp10[l][r] = (dp10[l][r] + dp10[l - 1][r]) % MD;
					dp11[l][r] = (dp11[l][r] + dp11[l - 1][r]) % MD;
				}
			for (int l = 1; l <= m; l++)
				for (int r = 1; r <= m; r++)
					dq00[l][r] = dq01[l][r] = dq10[l][r] = dq11[l][r] = 0;
			for (int l = 1; l <= m; l++)
				for (int r = l; r <= m; r++) {
					dq00[l][r] = 1;
					add(dq00, l, r, query(dp00, l, m, 1, r));
					add(dq01, l, r, query(dp01, l, r, r, m));
					add(dq01, l, r, query(dp00, l, r, r + 1, m));
					add(dq10, l, r, query(dp10, 1, l, l, r));
					add(dq10, l, r, query(dp00, 1, l - 1, l, r));
					add(dq11, l, r, query(dp11, 1, l, r, m));
					add(dq11, l, r, query(dp01, 1, l - 1, r, m));
					add(dq11, l, r, query(dp10, 1, l, r + 1, m));
					add(dq11, l, r, query(dp00, 1, l - 1, r + 1, m));
					ans = (ans + dq00[l][r] + dq01[l][r] + dq10[l][r] + dq11[l][r]) % MD;
				}
			int[][] tmp;
			tmp = dp00; dp00 = dq00; dq00 = tmp;
			tmp = dp01; dp01 = dq01; dq01 = tmp;
			tmp = dp10; dp10 = dq10; dq10 = tmp;
			tmp = dp11; dp11 = dq11; dq11 = tmp;
		}
		if (ans < 0)
			ans += MD;
		println(ans);
	}
}


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

public class VKA {

	static final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;

	public static void main(String[] args) {
		new VKA().run();
	}

	BufferedReader in;
	PrintWriter out;
	StringTokenizer tok;

	void init() throws FileNotFoundException {

		if (ONLINE_JUDGE) {
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);
		} else {
			in = new BufferedReader(new FileReader("input.txt"));
			out = new PrintWriter("output.txt");
		}

		tok = new StringTokenizer("");
	}

	void run() {
		try {
			long timeStart = System.currentTimeMillis();

			init();
			solve();

			out.close();

			long timeEnd = System.currentTimeMillis();
			System.err.println("Time = " + (timeEnd - timeStart));
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(-1);
		}
	}

	String readLine() throws IOException {
		return in.readLine();
	}

	String delimiter = " ";

	String readString() throws IOException {
		while (!tok.hasMoreTokens()) {
			String nextLine = readLine();
			if (null == nextLine) return null;

			tok = new StringTokenizer(nextLine);
		}

		return tok.nextToken(delimiter);
	}

	int readInt() throws IOException {
		return Integer.parseInt(readString());
	}

	long readLong() throws IOException {
		return Long.parseLong(readString());
	}

	int[] readIntArr(int n) throws IOException {
		int a[] = new int[n];
		for (int i = 0; i < n; i++) {
			a[i] = readInt();
		}
		return a;
	}

	long binpow (long a, long n, long m) {
		long res = 1 % m;
		while (n > 0) {
			if ((n & 1) == 1) {
				res *= a;
				res %= m;
				n--;
			} else {
				a *= a;
				a %= m;
				n >>= 1;
			}
		}
		return res;
	}

	long gcd (long a, long b) {
		while (b != 0 && a != 0) {
			if (a < b) {
				long t = a;
				a = b;
				b = t;
			}
			a %= b;
		}
		return a + b;
	}

	void solve() throws IOException {
		long n = readLong();
		long k = readLong();
		String res = "Yes";
		long z = (long)Math.sqrt(n) + 1;
		int[] ost = new int[100000000];

		for (long i = 2; i <= z && i <= k && i <= 100000000; i++) {
			ost[(int)(n % i)]++;
			if (ost[(int)(n % i)] > 1) {
				res = "No";
				break;
			}
		}

		out.println(res);
	}
}


import java.util.ArrayList;
import java.util.Scanner;

public class Masked{

	public static void main(String args[]){
		int t;
		Scanner scan = new Scanner(System.in);
		t= scan.nextInt();
		int max = t/2;
		int check[] = new int[t/2+1];
		int cannot = t/4;

		if(cannot*4 != t){
			cannot = -1;
		}

		ArrayList<Answer> listAnswer = new ArrayList<Answer>();
		int answer = 0;

		for(int i = 1 ; i < max ; i++){
			int d = i*2;
			int d1 = t-d;
			//System.out.println("d: "+d+" d1: "+d1);
			if(d1%2 == 0 && i != cannot ){
				answer++;
			}
		}

		System.out.println(answer/2);

	}

	private static class Answer{
		int a;
		int b;
		public Answer(int a, int b){
			this.a = a;
			this.b = b;
		}
	}

}


import java.util.*;

public class B106 {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String line = in.nextLine();
        StringTokenizer st = new StringTokenizer(line,":");

        String hour="";
        String now=st.nextToken();

        for(int i=0;i<now.length();i++)
            if(Character.isDigit(now.charAt(i)))hour+=now.charAt(i);
            else hour+=""+(now.charAt(i));

        String min="";
        now=st.nextToken();

        for(int i=0;i<now.length();i++)
            if(Character.isDigit(now.charAt(i)))min+=now.charAt(i);

        ArrayList<Integer> a = new ArrayList<Integer>();
        String flag="";

        for(double i=3;i<10000000;i++){
            try{
                if(Integer.parseInt(hour,(int)i)<24 && Integer.parseInt(min,(int)i)<60) {
                    a.add((int)i);
                    if(flag.endsWith("0")) {flag="o";break;}
                }
                else break;
            }catch(Exception e) {       flag="0"; }
        }

        if(flag.equals("o")) System.out.println("-1");
        else if(flag.equals("0")) System.out.println("0");
        else for(int i=0;i<a.size();i++) System.out.print(a.get(i)+ ((i==a.size()-1)?"":" "));

    }

}


package Hello2020;

import java.util.*;

public class Prob1284C {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int m = in.nextInt();
        long[] factorials = new long[250005];
        factorials[0] = 1;
        for (int i = 1; i <= n; i++) {
            factorials[i] = factorials[i - 1] * i % m;
        }
        long ans = 0;
        for (int i = 1; i <= n; i++) {
            ans += (n - i + 1) * (factorials[i] * factorials[n - i + 1] % m);
            ans %= m;
        }
        System.out.println(ans);
    }
}


import java.io.*;
import java.util.Scanner;
import java.util.StringTokenizer;

/**
 * Created by JUSTIN on 2/23/17.
 */
public class cowqueue extends IOException{
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        long numberoflines = s.nextLong();
        long possiblesquarecount = 0;

        for (long i = 1; i <= numberoflines; i++) { //i stands for the row number

            if (i % 2 != 0) { //checks if it is an odd line or even line
                for (long m = 1; m <= numberoflines; m++) { //checks the individual tile
                    if (m % 2 != 0) {
                        possiblesquarecount++;
                    }
                }
            }

            else {
                for (long m = 1; m <= numberoflines; m++) { //checks the individual tile
                    if (m % 2 == 0) {
                        possiblesquarecount++;
                    }
                }

            }

        }

        if (possiblesquarecount % 2 != 0) {
            System.out.println(1);

        }
        else {
            System.out.print(2);
        }

    }

}


import java.util.Scanner;

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

//********************************************************K.S.J _@@@@@@@@@@@@@@@@@@@@@@@@@******************************
public class timerSiyapa{
	static BufferedReader reader;
    static StringTokenizer tokenizer;

	static void init(InputStream input) {reader = new BufferedReader(new InputStreamReader(input) );
        tokenizer = new StringTokenizer("");
    }
	static String next() throws IOException {
        while (!tokenizer.hasMoreTokens() ) { tokenizer = new StringTokenizer(reader.readLine() );}
        return tokenizer.nextToken();
    }
	static String nextLine() throws IOException { return  next();}
	static int nextInt() throws IOException {return Integer.parseInt( next() );}
	static double nextDouble() throws IOException {return Double.parseDouble( next() );}
	static long nextLong() throws IOException {return Long.parseLong( next() );}
	static BigInteger nextBigInteger() throws IOException {return new BigInteger(next()) ;}

	public static void main(String args[]) throws IOException{
		init(System.in);
		int no=nextInt();
			int t=0,timer=0,a=0,flag=0;
		for(int i=0;i<no;i++){

			if(i==0){a=nextInt();if(a<=15&&no==1){flag=1; System.out.println(a+15);break;}else if(a>15){flag=1;System.out.println("15");break;}}
			else{
					t=nextInt();
					if((t-a)<=15 ){
						a=t;
					}
					else{
						flag=1;
						System.out.println(a+15);break;}

					}

				}

				if(flag==0){
					if(a+15<=90){
					System.out.println(a);}
					else{
						System.out.println("90");
					}
				}
	}

}


import java.util.*;

public class R219Div2QB {
	public static void main(String[] args){
		Scanner s = new Scanner(System.in);
		String stringInput[] = s.nextLine().split(" ");
		Long[] inputs = {Long.parseLong(stringInput[0]), Long.parseLong(stringInput[1]), Long.parseLong(stringInput[2])};
		Long w = inputs[0];
		Long m = inputs[1]-1;
		Long k = inputs[2];
		ArrayList<Long> sq = new ArrayList<Long>();
		while(w >= k){
			m++;
			w -= s(m) * k;
			if(w < 0)
				break;
			sq.add(m);
		}
		System.out.println(sq.size());
		s.close();
	}
	public static int s(Long n){
		return n.toString().length();
	}
}


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

public class B373 {
	static long w;
	static long k;

	static boolean check(long x, long first) {
		long q = 1;
		int count = 0;
		while (q <= first) {
			q *= 10;
			count++;
		}
		long sum = 0;
		if (q < x) {
			sum = ((q / 10) * 9 - first + 1) * count;
			while (q * 10 < x) {
				sum += 9 * q * (count + 1);
				q *= 10;
				count++;
			}
			count++;
			sum += count * (x - q + 1);
		} else {
			sum = (x - first + 1) * count;
		}
		if ((double) w / k >= sum) {
			return true;
		} else {
			return false;
		}
	}

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		w = in.nextInt();
		long m = in.nextInt();
		k = in.nextInt();
		long l = m;
		long r = m + 100000000L * 100000000;
		while (l + 1 != r) {
			long m1 = (l + r) / 2;
			if (check(m1, m)) {
				if (check(m1, m)) {
					l = m1;
				}
			} else {
				r = m1;
			}
		}
		if (check(r, m)) {
			out.print(r - m + 1);
		} else {
			if (check(l, m)) {
				out.print(l - m + 1);
			} else {
				out.print(0);
			}
		}
		out.close();
	}
}


import java.io.*;
import java.util.*;
import java.lang.Math;
import java.math.BigInteger;

public class Problem {

	public static void main(String[] args) throws IOException {

		new Problem().run();
	}

	BufferedReader in;
	PrintWriter out;
	StringTokenizer tok;
	Random rnd = new Random();
	static final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;

	Problem() throws FileNotFoundException {

		if (ONLINE_JUDGE) {
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);
		} else {
			in = new BufferedReader(new FileReader("input.txt"));
			out = new PrintWriter("output.txt");
		}
		tok = new StringTokenizer("");
	}

	List<Integer>[] graph;
	boolean[] used1;
	boolean[] used2;
	int[] ans;
	int[] a;
	int[] countDiv;
	ArrayList<Integer> divs = new ArrayList<>();;

	void solve() throws IOException {
		int n = rI();
		int k = rI();
		int m = rI();
		int[] a = readSortedIntArray(k);
		int ans=0;

		for(int i=0;i<k-2;++i){
			ans+=Math.min(n, m/a[i]);
			m-=Math.min(m, a[i]*n);

		}

		int po2 = Math.min(n*3, m/(a[k-2]+a[k-1])*3);
		int po1 = a[k-2]*Math.min(n, m/a[k-2])+2*(a[k-1]*Math.min((m-Math.min(n, m/a[k-2]))/a[k-1], n));
		ans+=Math.max(po2, po1);
		out.println(ans);
	}

	// ======================================================
	class SegmentTree {

		int[] tree;

		SegmentTree(int n) {
			tree = new int[n];
		}

		void build(int[] a, int v, int curL, int curR) {
			if (curL == curR) {
				this.tree[v] = a[curL];
			} else {
				int mid = (curL + curR) / 2;
				build(a, v * 2, curL, mid);
				build(a, v * 2 + 1, mid + 1, curR);
				this.tree[v] = this.tree[v * 2] + this.tree[v * 2 + 1];
			}
		}

	}

	class Dsu {
		int[] parents;
		int countUnions;

		Dsu(int size) {
			this.parents = new int[size];
			for (int i = 0; i < size; ++i) {
				parents[i] = i;
			}
			this.countUnions = size;
		}

		int get(int v) {
			if (v == parents[v])
				return v;
			return parents[v] = get(parents[v]);
		}

		boolean union(int a, int b) {
			a = get(a);
			b = get(b);
			if (a == b) {
				return false;
			}
			if (rnd.nextBoolean()) {
				parents[a] = b;
			} else {
				parents[b] = a;
			}
			this.countUnions--;
			return true;
		}
	}

	// ======================================================
	void run() throws IOException {
		solve();
		out.close();
	}

	char[] reverseCharArray(char[] arr) {
		char[] ans = new char[arr.length];
		for (int i = 0; i < arr.length; ++i) {
			ans[i] = arr[arr.length - i - 1];
		}
		return ans;
	}

	int sqrt(double m) {
		int l = 0;
		int r = 1000000000 + 9;
		int i = 1000;
		while (r - l > 1) {
			int mid = (r + l) / 2;
			if (mid * mid > m) {
				r = mid;
			} else {
				l = mid;
			}
		}
		return l;
	}

	int countPow(int m, int n) {
		int ans = 0;
		while (m % n == 0 && m > 0) {
			ans++;
			m /= n;
		}
		return ans;
	}

	long binPow(long a, long b) {
		if (b == 0) {
			return 1;
		}
		if (b % 2 == 1) {
			return a * binPow(a, b - 1);
		} else {
			long c = binPow(a, b / 2);
			return c * c;
		}

	}

	int gcd(int a, int b) {
		return b == 0 ? a : gcd(b, a % b);
	}

	long pow(long x, long k) {
		long ans = 1;
		for (int i = 0; i < k; ++i) {
			ans *= x;
		}
		return ans;
	}

	// ////////////////////////////////////////////////////////////////////

	String delimiter = " ";

	String readLine() throws IOException {
		return in.readLine();
	}

	String rS() throws IOException {
		while (!tok.hasMoreTokens()) {
			String nextLine = readLine();
			if (null == nextLine)
				return null;

			tok = new StringTokenizer(nextLine);
		}

		return tok.nextToken(delimiter);
	}

	int rI() throws IOException {
		return Integer.parseInt(rS());
	}

	long rL() throws IOException {
		return Long.parseLong(rS());
	}

	int[] rA(int b) {
		int a[] = new int[b];
		for (int i = 0; i < b; i++) {
			try {
				a[i] = rI();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		return a;
	}

	int[] readSortedIntArray(int size) throws IOException {
		Integer[] array = new Integer[size];

		for (int index = 0; index < size; ++index) {
			array[index] = rI();
		}
		Arrays.sort(array);

		int[] sortedArray = new int[size];
		for (int index = 0; index < size; ++index) {
			sortedArray[index] = array[index];
		}

		return sortedArray;
	}

	int[] sortedIntArray(int size, int[] array) throws IOException {
		for (int index = 0; index < size; ++index) {
			array[index] = rI();
		}
		Arrays.sort(array);

		int[] sortedArray = new int[size];
		for (int index = 0; index < size; ++index) {
			sortedArray[index] = array[index];
		}

		return sortedArray;
	}
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.FilterInputStream;
import java.io.BufferedInputStream;
import java.util.Collections;
import java.util.ArrayList;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author JENISH
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        ScanReader in = new ScanReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BMathShow solver = new BMathShow();
        solver.solve(1, in, out);
        out.close();
    }

    static class BMathShow {
        public void solve(int testNumber, ScanReader in, PrintWriter out) {
            int n = in.scanInt();
            int k = in.scanInt();
            long m = in.scanLong();
            int t[] = new int[k];
            long sum = 0;
            in.scanInt(t);
            for (int kk : t) sum += kk;

            long res = 0;
            for (int i = 0; i <= n; i++) {
                long ans = 0;
                int rem = n - i;
                if (sum * (i) <= m) {
                    ans += i * (k + 1);
                    m -= i * sum;

                    ArrayList<Integer> arrayList = new ArrayList<>();
                    for (int kk : t) {
                        for (int j = 0; j < rem; j++) {
                            arrayList.add(kk);
                        }
                    }
                    Collections.sort(arrayList);

                    for (int j = 0; i < arrayList.size(); j++) {
                        if (arrayList.get(j) <= m) {
                            ans++;
                            m -= arrayList.get(j);
                        } else {
                            break;
                        }
                    }
                }

                res = Math.max(ans, res);

            }
            out.println(res);

        }

    }

    static class ScanReader {
        private byte[] buf = new byte[4 * 1024];
        private int INDEX;
        private BufferedInputStream in;
        private int TOTAL;

        public ScanReader(InputStream inputStream) {
            in = new BufferedInputStream(inputStream);
        }

        private int scan() {
            if (INDEX >= TOTAL) {
                INDEX = 0;
                try {
                    TOTAL = in.read(buf);
                } catch (Exception e) {
                    e.printStackTrace();
                }
                if (TOTAL <= 0) return -1;
            }
            return buf[INDEX++];
        }

        public int scanInt() {
            int I = 0;
            int n = scan();
            while (isWhiteSpace(n)) n = scan();
            int neg = 1;
            if (n == '-') {
                neg = -1;
                n = scan();
            }
            while (!isWhiteSpace(n)) {
                if (n >= '0' && n <= '9') {
                    I *= 10;
                    I += n - '0';
                    n = scan();
                }
            }
            return neg * I;
        }

        private boolean isWhiteSpace(int n) {
            if (n == ' ' || n == '\n' || n == '\r' || n == '\t' || n == -1) return true;
            else return false;
        }

        public long scanLong() {
            long I = 0;
            int n = scan();
            while (isWhiteSpace(n)) n = scan();
            int neg = 1;
            if (n == '-') {
                neg = -1;
                n = scan();
            }
            while (!isWhiteSpace(n)) {
                if (n >= '0' && n <= '9') {
                    I *= 10;
                    I += n - '0';
                    n = scan();
                }
            }
            return neg * I;
        }

        public void scanInt(int[] A) {
            for (int i = 0; i < A.length; i++) A[i] = scanInt();
        }

    }
}


import java.util.Scanner;
import java.util.ArrayList;

public class Practica_2 {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int day = in.nextInt();
        int kg = in.nextInt();
        String c = "";
        for (int i = 0; i < day; i++) {
            int a = in.nextInt();
            c += a + " ";
        }
        String d = c.trim();
        ArrayList<Integer> bca = new ArrayList<Integer>();
        String array[] = d.split(" +");
        int pos = 0;
        while (pos < array.length - 1) {
            if (Integer.parseInt(array[pos]) > Integer.parseInt(array[pos + 1])) {
                int resta = Integer.parseInt(array[pos]) - Integer.parseInt(array[pos + 1]) - kg;
                bca.add(resta);
            }
            pos++;
        }
        if (bca.size() == 0) {
            System.out.println(0);
        } else {
            int mayor = bca.get(0);
            for (int i = 0; i < bca.size(); i++) {
                if (mayor < bca.get(i)) {
                    mayor = bca.get(i);
                }
            }
            System.out.println(mayor);
        }
    }
}


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

public class Solution {

    public static void main(String[] args) {
        /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */
        Scanner s =new Scanner(System.in);
        int n=s.nextInt();
        int m=s.nextInt();
        if(n%m==0)
            System.out.println("YES");
        else
            System.out.println("NO");

   }

}


//package elephant;

import java.util.Scanner;

public class Elephant {
    public static void main (String[] args){
        Scanner r = new Scanner(System.in);

        int goal = r.nextInt();

        System.out.println(jump(0,goal,0));

    }

    public static int jump(int current, int target, int steps){
        if(current==target){
            return steps;
        }

        int[] stepcounter = new int[5];
        for(int i = 0; i <stepcounter.length; i++){
            stepcounter[i]= Integer.MAX_VALUE;
        }
        if(current+1<=target)
            stepcounter[0] = jump((current<=target) ? current+1: current-1,target,steps+1);
        if(current+2<=target)
            stepcounter[1] = jump((current<=target) ? current+2: current-2,target,steps+1);
        if(current+3<=target)
            stepcounter[2] = jump((current<=target) ? current+3: current-3,target,steps+1);
        if(current+4<=target)
            stepcounter[3] = jump((current<=target) ? current+4: current-4,target,steps+1);
        if(current+5<=target)
            stepcounter[4] = jump((current<=target) ? current+5: current-5,target,steps+1);

        int min = Integer.MAX_VALUE;
        for(int i = 0; i<=4; i++){
            if (stepcounter[i]<min){
                min = stepcounter[i];
            }
        }
        return min;
    }
}


import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Scanner;
import java.util.Stack;

public class Main {

    private static class Graph
    {

        private int n;
        private ArrayList< ArrayList< Integer > > adjacencyList;
        private int[] degree;

        private Graph( int n )
        {
            this.n = n;
            this.adjacencyList = new ArrayList< ArrayList< Integer > >();
            this.degree = new int[ n ];
            for ( int i = 0; i < n; i++ )
            {
                this.adjacencyList.add( new ArrayList< Integer >() );
                this.degree[ i ] = 0;
            }
        }

        private void addEdge( int u, int v )
        {
            // Undirected Graph
            adjacencyList.get( u ).add( v );
            degree[ u ]++;
        }

        private int DFS(int node){
            int[] visited = new int[n];
            Stack<Integer> DFS = new Stack<>();
            int count = 0;
            DFS.push(node);

            while (!DFS.isEmpty()){
                int currentNode = DFS.pop();
                if (visited[currentNode] == 0){
                    count++;
                }
                visited[currentNode] = 1;
                for( Integer adj : adjacencyList.get(currentNode)){
                    if (adj == -1) {
                        continue;
                    }
                    if (visited[adj] == 0){
                        DFS.push(adj);
                    }
                }
            }

            return count;
        }

        private String connected(){
            for (int i = 0; i < n; i++) {
                if (DFS(i) != n) {
                    return "NO";
                }
            }
            return "YES";
        }
    }

    public static void main(String[] args) throws IOException {
        System.setIn(new FileInputStream( new File( "C:\\Users\\gaarj\\IdeaProjects\\CF4\\src\\test.txt")));
        Scanner scanner = new Scanner(System.in);
        int horizontal = scanner.nextInt();
        int vertical = scanner.nextInt();
        Graph g = new Graph(horizontal * vertical);
        // Add edges to the graph
        String hRoads = scanner.next();
        for (int i = 0; i < horizontal; i++) {
            if (hRoads.charAt(i) == '>'){
                for (int j = 0; j < vertical - 1; j++){
                    g.addEdge((vertical*i) + j, (vertical*i) + j + 1);
                }
            }
            else {
                for (int j = 0; j < vertical - 1; j++){
                    g.addEdge((vertical*i) + j + 1, (vertical*i) + j);
                }
            }
        }
        String vRoads = scanner.next();
        for (int i = 0; i < vertical; i++) {
            if (vRoads.charAt(i) == 'v'){
                for (int j = 0; j < horizontal - 1; j++){
                    g.addEdge((vertical*j) + i, (vertical*(j + 1)) + i);
                }
            }
            else {
                for (int j = 0; j < horizontal - 1; j++){
                    g.addEdge((vertical*(j + 1)) + i, (vertical*j) + i);
                }
            }
        }

        System.out.println(g.connected());

    }
}


import java.util.ArrayList;
import java.util.Scanner;
import java.util.TreeSet;

public class Main {
   public static boolean cont(String a, String b)
   {
       boolean flag = false;
       int length = a.length();
       for ( int i = 0; i < length; i++ )
       {
           if ( b.contains(""+a.charAt(i) )) flag = true;
       }
       return flag;
   }
   public static ArrayList numerosPrimos(int n)
   {
       boolean[] flags = new boolean[n+1];
       ArrayList aList = new ArrayList();

       for ( long i = 2; i < n+1 ; i++)
       {
           if (flags[(int)i]) continue;
           for ( long j = i-1; i * j < n+1; j++ )
           {
               flags[(int)(i*j)] = true;
           }

       }
       aList.add(2);
       for ( int i= 2; i < n+1; i++)
           if (!flags[i])
               aList.add(i);
       return aList;
   }
   public static ArrayList divisores(int n)
   {
       ArrayList<Integer> primos = numerosPrimos(n), primosQD = new ArrayList<Integer>(), elevado = new ArrayList<Integer>();
       int length = primos.size(),count,primo,elev,tam;
       for ( int i = 0; i < length; i++)
       {
           primo = primos.get(i);
           if( n % primo == 0 )
           {
               count = -1;
               while( n % primo == 0)
               {
                   n /=primo; count++;
               }
               primosQD.add(primo); elevado.add(count);
           }
       }
       length = primosQD.size();
       for ( int i = 0; i < length; i++ )
       {
           elev = elevado.get(i);
           tam = primosQD.size();
           for ( int j = 0; j < elev; j++ )
           {
               for ( int k = 0; k < tam; k++ )
               {
                   primosQD.add( primosQD.get(k)*(int)Math.pow(primosQD.get(i),j+1) );
               }
           }
       }
       return primosQD;

   }
    public static void main(String[] args) {

        Scanner input = new Scanner(System.in);
        int value = input.nextInt();
        TreeSet<Integer> set = new TreeSet<Integer>();
        ArrayList<Integer> divisores =divisores(value);
        int length = divisores.size(), n, count = 0;
        set.add(1); set.add(value);
        for ( int i = 0; i < length; i++ ) set.add(divisores.get(i));
        length = set.size();
        for ( int i = 0; i < length; i++ )
        {
            n =set.pollFirst();
            if (cont(""+value,""+n)) count++;
        }
        System.out.println(count);
    }
}


import java.math.BigInteger;
import java.util.Scanner;
import java.util.Arrays;
public class AboutBacteria {
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        BigInteger k = in.nextBigInteger();
        BigInteger b = in.nextBigInteger();
        BigInteger n = in.nextBigInteger();
        BigInteger [] t = new BigInteger[n.intValue()+1];
        t[0] = in.nextBigInteger();
        BigInteger  x = BigInteger.ONE;
        BigInteger z = BigInteger.ZERO;
        int numOfSeconds = 0;
        for(int i = 0; i < n.intValue() ; i++)
        {
            z = (x.multiply(k)).add(b);
            t[i+1] = (t[i].multiply(k)).add(b);
            x = z;
        }
        if(z.compareTo(t[0]) <= 0)
            numOfSeconds = 0;
        else
        {
            numOfSeconds = Math.abs(Arrays.binarySearch(t, z)+1);
            while (numOfSeconds == 0){
                z = z.add(BigInteger.ONE);
                numOfSeconds = Math.abs(Arrays.binarySearch(t, z)+1);
            }
        }
        System.out.println(numOfSeconds);
    }
}


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

public class main{

    public static void main(String args[]){
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        try{
            String s = br.readLine();

            s = s.toLowerCase();
            StringBuilder sb=new StringBuilder(s);

            for(int i=0; i<sb.length(); i++){

                if(sb.charAt(i) == 'a' || sb.charAt(i) == 'e' || sb.charAt(i) == 'i' || sb.charAt(i) == 'o' || sb.charAt(i) == 'u')
                            sb.delete(i,i);

            }

            for(int j=0; j<sb.length(); j++){

                sb.insert(j,".");

            }
            System.out.println(sb.toString());

        }catch(IOException e){

        }
    }
}


import java.util.Scanner;

public class IncArc {

    public static void main(String[]arsg){
        Scanner in = new Scanner (System.in);
        int n = in.nextInt();
        char a[] = new char[n];
        int k =0;
        String x = in.next();
        for(int i = n-1 ; i>=0 ; i--){
            a[i] = x.charAt(k);
            k++;
        }
        String y = new String(a);
        int z = Integer.parseInt(y,2);
        z++;
        if(z >= 9)
            z = Math.abs(16-z);
        y = Integer.toBinaryString(z);
        int result = 0;
        while(x.length() != y.length()){
            y = '0'+y;
        }
        for(int i = 0 ; i< n ; i++){
            if(x.charAt(i) != y.charAt(n-i-1))
                result ++;
        }
        System.out.println(result);
    }
}


package com.sairam.practice.codeforces;

import java.util.Scanner;

/**
 * created at 04/10/17 12:57 PM
 */
public class P378A {
  public static void main(String[] args) {
    Scanner input = new Scanner(System.in);

    int a = input.nextInt();
    int b = input.nextInt();

    int f = 0, s = 0, d = 0;

    for(int i = 1; i <= 6; i++) {
      int fd = Math.abs(i - a);
      int sd = Math.abs(i - b);

      if(fd == sd) {
        d++;
      } else if(fd < sd) {
        f++;
      } else {
        s++;
      }
    }

    System.out.println(f + " " + d + " " + s);

  }
}


import java.util.*;

import java.io.*;
import java.math.*;
 public class Q1 {

	static ArrayList<Integer> adj[],adj2[];
	static int color[],cc;
	static long mod=1000000007;
	static TreeSet<Integer> ts;
	static boolean b[],visited[],possible,ans1,ans2;
	static Stack<Integer> s;
	static int totalnodes,colored,minc;
	static int c[],a[],n,parent[],ans[],size[];
	static long sum[];
	static HashMap<Integer,Integer> hm;
	public static void main(String[] args) throws IOException {

	//	Scanner sc=new Scanner(System.in);
		in=new InputReader(System.in);
		out=new PrintWriter(System.out);
		int n=in.nextInt();
		int m=in.nextInt();
		int l[]=new int[m];
		l=in.nextIntArray(m);
		int a[]=new int[n+1];
		boolean check[]=new boolean[n];
	 ts=new TreeSet<>();
		for(int i=1;i<=n;i++)
		{
			ts.add(i);
		}

		for(int i=0;i<m-1;i++)
		{

			if(l[i]<l[i+1])
			{
				if(a[l[i]-1]==l[i+1]-l[i])
					continue;
				a[l[i]-1]=l[i+1]-l[i];
				ts.remove(a[l[i]-1]);
			}
			else
			{

				if(a[l[i]-1]==n-l[i]+l[i+1])
					continue;
				a[l[i]-1]=n-l[i]+l[i+1];

				ts.remove(a[l[i]-1]);
			}
		}
		for(int i=0;i<n;i++)
		{
			if(a[i]==0)
			{
				a[i]=ts.pollFirst();
			}
		}
		if(!ts.isEmpty())
		{
			out.println("-1");
			out.close();
			System.exit(0);
		}
		for(int i=0;i<n;i++)
		{
			if(ts.contains(a[i]))
			{
				out.println("-1");
				out.close();
				System.exit(0);
			}
			else
			{
				ts.add(a[i]);
			}
		}
		for(int i=0;i<n;i++)
		{
			out.print(a[i]+" ");
		}
		out.close();
		}
	static int check(int m)
	{
		int c=0;
		for(int i=0;i<n-1;i++)
		{
			int l=i;
			int r=n-1;
			while(l<r)
			{
				int mid=(l+r)/2;

				if(a[i]+m+1>a[mid])
					l=mid+1;
				else
					r=mid;
			}
		//debug(" l****** "+l);
			if(!(a[l]-a[i]<=m))
			while(a[l]==a[l-1])
				l--;

		//	debug((l-1-(i)));
			if(l==n-1 && !(a[l]-a[i]>m) )
				c=c+l-i;
			else
			c=c+(l-1-(i));
		}

		return c;
	}
	static InputReader in;
	static PrintWriter out;
 	static void dfs(int i)
	{
 		 size[i]=1;int badabeta=0;
 		 for(int j=0;j<adj[i].size();j++)
 		 {
 			 int son=adj[i].get(j);
 			 dfs(son);
 			 size[i]+=size[son];

 			 if(size[son]>size[badabeta])
 				 badabeta=son;
 		 }
 		 if(size[badabeta]*2>size[i])
 		 {
 			 int dada = ans[badabeta];
 			 while((size[i]-size[dada])*2>size[i])
 				 dada=parent[dada];
 			 ans[i]=dada;
 		 }

	}
	/*public static void seive(long n){
		b = new boolean[(int) (n+1)];
	Arrays.fill(b, true);

		for(int i = 2;i*i<=n;i++){
			if(b[i]){
				sum[i]=count[i];
			//	System.out.println(sum[i]+" wf");
				for(int p = 2*i;p<=n;p+=i){
					b[p] = false;
					sum[i]+=count[p];
					//System.out.println(sum[i]);
				}
			}

		}
	}*/
	static class Pair implements Comparable<Pair> {
		int i;
		int j;
		//int index;
		public Pair(){

		}
		public Pair(int u, int v) {
			this.i = u;
			this.j= v;

		}
		public int compareTo(Pair other) {

				return this.j-other.j;
		}

		/*public String toString() {
			return "[u=" + u + ", v=" + v + "]";
		}*/
	}
	static class Node2{
		Node2 left = null;
		Node2 right = null;
		Node2 parent = null;
		int data;
	}

	//binaryStree
	static class BinarySearchTree{
		Node2 root = null;
		int height = 0;
		int max = 0;
		int cnt = 1;
		ArrayList<Integer> parent = new ArrayList<>();
		HashMap<Integer, Integer> hm = new HashMap<>();
		public void insert(int x){
			Node2 n = new Node2();
			n.data = x;
			if(root==null){
				root = n;
			}
			else{
				Node2 temp = root,temp2 = null;
				while(temp!=null){
					temp2 = temp;
					if(x>temp.data) temp = temp.right;
					else temp = temp.left;
				}
				if(x>temp2.data) temp2.right = n;
				else temp2.left = n;
				n.parent = temp2;
				parent.add(temp2.data);
			}
		}
		public Node2 getSomething(int x, int y, Node2 n){
			if(n.data==x || n.data==y) return n;
			else if(n.data>x && n.data<y) return n;
			else if(n.data<x && n.data<y) return getSomething(x,y,n.right);
			else return getSomething(x,y,n.left);
		}
		public Node2 search(int x,Node2 n){
			if(x==n.data){
				max = Math.max(max, n.data);
				return n;
			}
			if(x>n.data){
				max = Math.max(max, n.data);
				return search(x,n.right);
			}
			else{
				max = Math.max(max, n.data);
				return search(x,n.left);
			}
		}
		public int getHeight(Node2 n){
			if(n==null) return 0;
			height = 1+ Math.max(getHeight(n.left), getHeight(n.right));
			return height;
		}
	}
public static void debug(Object... o) {
	System.out.println(Arrays.deepToString(o));
}

public static String rev(String s)
{
	StringBuilder sb=new StringBuilder(s);
	sb.reverse();
	return sb.toString();
}

static long lcm(long a, long b)
{
    return a * (b / gcd(a, b));
}

static long gcd(long a, long b)
{
    while (b > 0)
    {
        long temp = b;
        b = a % b; // % is remainder
        a = temp;
    }
    return a;
}

public static long max(long x, long y, long z){
		if(x>=y && x>=z) return x;
		if(y>=x && y>=z) return y;
		return z;
	}
	static int[] sieve(int n,int[] arr)
	{
	for(int i=2;i*i<=n;i++)
	{
		if(arr[i]==0)
		{
			for(int j=i*2;j<=n;j+=i)
				arr[j]=1;
		}
	}
	return arr;
	}

static class InputReader {

private final InputStream stream;
private final byte[] buf = new byte[8192];
private int curChar, snumChars;
private SpaceCharFilter filter;

public InputReader(InputStream stream) {
  this.stream = stream;
}

public int snext() {
  if (snumChars == -1)
    throw new InputMismatchException();
  if (curChar >= snumChars) {
    curChar = 0;
    try {
      snumChars = stream.read(buf);
    } catch (IOException e) {
      throw new InputMismatchException();
    }
    if (snumChars <= 0)
      return -1;
  }
  return buf[curChar++];
}

public int nextInt() {
  int c = snext();
  while (isSpaceChar(c)) {
    c = snext();
  }
  int sgn = 1;
  if (c == '-') {
    sgn = -1;
    c = snext();
  }
  int res = 0;
  do {
    if (c < '0' || c > '9')
      throw new InputMismatchException();
    res *= 10;
    res += c - '0';
    c = snext();
  } while (!isSpaceChar(c));
  return res * sgn;
}

public long nextLong() {
  int c = snext();
  while (isSpaceChar(c)) {
    c = snext();
  }
  int sgn = 1;
  if (c == '-') {
    sgn = -1;
    c = snext();
  }
  long res = 0;
  do {
    if (c < '0' || c > '9')
      throw new InputMismatchException();
    res *= 10;
    res += c - '0';
    c = snext();
  } while (!isSpaceChar(c));
  return res * sgn;
}

public int[] nextIntArray(int n) {
	 return nextIntArray(n, 0);
	    }

public int[] nextIntArray(int n, int off) {
	 int[] arr = new int[n + off];
	   for (int i = 0; i < n; i++) {
	    arr[i + off] = nextInt();
	    }
	    return arr;
	    }

public long[] nextLongArray(int n) {
return nextLongArray(n, 0);
	    }

	public long[] nextLongArray(int n, int off) {
	 long[] arr = new long[n + off];
	 for (int i = 0; i < n; i++) {
		  arr[i + off] = nextLong();
		 }
 return arr;
	}

public String readString() {
  int c = snext();
  while (isSpaceChar(c)) {
    c = snext();
  }
  StringBuilder res = new StringBuilder();
  do {
    res.appendCodePoint(c);
    c = snext();
  } while (!isSpaceChar(c));
  return res.toString();
}

public String nextLine() {
  int c = snext();
  while (isSpaceChar(c))
    c = snext();
  StringBuilder res = new StringBuilder();
  do {
    res.appendCodePoint(c);
    c = snext();
  } while (!isEndOfLine(c));
  return res.toString();
}

public boolean isSpaceChar(int c) {
  if (filter != null)
    return filter.isSpaceChar(c);
  return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
}

private boolean isEndOfLine(int c) {
  return c == '\n' || c == '\r' || c == -1;
}

public interface SpaceCharFilter {
  public boolean isSpaceChar(int ch);
}
}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.StringTokenizer;

public class Solver {

    StringTokenizer st;
    BufferedReader in;
    PrintWriter out;

    public static void main(String[] args) throws NumberFormatException,
            IOException {
        Solver solver = new Solver();
        solver.open();
        solver.solve();
        solver.close();
    }

    public void open() throws IOException {
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
    }

    public String nextToken() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            st = new StringTokenizer(in.readLine());
        }
        return st.nextToken();
    }

    public int nextInt() throws NumberFormatException, IOException {
        return Integer.parseInt(nextToken());
    }

    public long nextLong() throws NumberFormatException, IOException {
        return Long.parseLong(nextToken());
    }

    public double nextDouble() throws NumberFormatException, IOException {
        return Double.parseDouble(nextToken());
    }

    int MOD = 1000000007;

    long[][] mul(long[][] m1, long[][] m2) {
        return new long[][] {
                { (m1[0][0] * m2[0][0] + m1[0][1] * m2[1][0]) % MOD,
                        (m1[0][0] * m2[0][1] + m1[0][1] * m2[1][1]) % MOD },
                { (m1[1][0] * m2[0][0] + m1[1][1] * m2[1][0]) % MOD,
                        (m1[1][0] * m2[0][1] + m1[1][1] * m2[1][1]) % MOD } };
    }

    public long[][] binPow(long[][] matr, long n) {
        long[][] result = new long[][] { { 1l, 0l }, { 0l, 1l } };
        while (n > 0) {
            if (n % 2 == 1) {
                result = mul(result,matr);
                n--;
            }
            matr = mul(matr,matr);
            n >>= 1;
        }
        return result;
    }

    public void solve() throws NumberFormatException, IOException {
        long[][] matr = binPow(new long[][]{{3,1},{1,3}}, nextInt());
        out.println(matr[0][0]);
    }

    public void close() {
        out.flush();
        out.close();
    }

}


import java.util.Scanner;
public class Main
{
    static String input;
    static int lessThan;
    static void answer(String str){
        if (str.length() != 0 && Integer.valueOf(str) >= Integer.valueOf(input))
            return;
        lessThan++;
        answer(str + "4");
        answer(str + "7");
    }
	public static void main(String[] args) {
	    lessThan = 0;
	    Scanner sc= new Scanner(System.in);
	    input = sc.nextLine();
	    answer("");
	   System.out.println(lessThan);
	}
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.HashSet;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        AMikeAndCellphone solver = new AMikeAndCellphone();
        solver.solve(1, in, out);
        out.close();
    }

    static class AMikeAndCellphone {
        static HashSet<String> set;

        public static void permut(String s, int len, String ans) {
            if (ans.length() == len) {
                set.add(ans);
                return;
            }
            for (int i = 0; i < s.length(); i++)
                permut(s.substring(0, i) + s.substring(i + 1), len, ans + s.charAt(i));
        }

        public void solve(int testNumber, InputReader sc, OutputWriter out) {
            int n = sc.nextInt();
            String s = sc.nextString();
            int ar[][] = new int[4][3];
            int k = 1;
            for (int i = 0; i < 3; i++) {
                for (int j = 0; j < 3; j++) {
                    ar[i][j] = k;
                    k++;
                }
            }
            ar[3][1] = 0;
            AMikeAndCellphone.vector vec[][] = new AMikeAndCellphone.vector[10][10];
            for (int i = 0; i < 10; i++) {
                for (int j = 0; j < 10; j++) {
                    int x1 = 0;
                    int y1 = 0;
                    int x2 = 0;
                    int y2 = 0;
                    for (int a = 0; a < 4; a++) {
                        for (int b = 0; b < 3; b++) {
                            if (ar[a][b] == i) {
                                x1 = a;
                                y1 = b;
                            }
                            if (ar[a][b] == j) {
                                x2 = a;
                                y2 = b;
                            }
                        }
                    }
                    int x = x2 - x1;
                    int y = y2 - y1;
                    vec[i][j] = new AMikeAndCellphone.vector(x, y);
                }
            }
            set = new HashSet<>();
            permut("0123456789", n, "");
            int f = 0;
            for (String st : set) {
                int count = 0;
                if (st.equals(s))
                    continue;
                for (int i = 1; i < n; i++) {
                    int a1 = Integer.parseInt("" + s.charAt(i - 1));
                    int b1 = Integer.parseInt("" + s.charAt(i));
                    int a2 = Integer.parseInt("" + st.charAt(i - 1));
                    int b2 = Integer.parseInt("" + st.charAt(i));
                    AMikeAndCellphone.vector v1 = vec[a1][b1];
                    AMikeAndCellphone.vector v2 = vec[a2][b2];
                    if (v1.x == v2.x && v1.y == v2.y) {
                        count++;
                    }
                }
                if (count == n - 1) {
                    f++;
                }
            }
            if (f > 0)
                out.println("NO");
            else
                out.println("YES");
        }

        static class vector {
            int x;
            int y;

            public vector(int x, int y) {
                this.x = x;
                this.y = y;
            }

        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public String nextString() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do {
                if (Character.isValidCodePoint(c)) {
                    res.appendCodePoint(c);
                }
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void print(Object... objects) {
            for (int i = 0; i < objects.length; i++) {
                if (i != 0) {
                    writer.print(' ');
                }
                writer.print(objects[i]);
            }
        }

        public void println(Object... objects) {
            print(objects);
            writer.println();
        }

        public void close() {
            writer.close();
        }

    }
}


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

public class Codeforces394_2B {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] s = br.readLine().split(" ");
		int n = Integer.parseInt(s[0]);
		int L = Integer.parseInt(s[1]);

		String[] s1 = br.readLine().split(" ");
		String[] s2 = br.readLine().split(" ");
		int[] a = new int[n];
		int[] b = new int[n];
		for (int i = 0; i < n; i++) {
			a[i] = Integer.parseInt(s1[i]);
			b[i] = Integer.parseInt(s2[i]);
		}
		for (int i = n - 1; i >= 0; i++) {
			a[i] -= a[0];
			b[i] -= b[0];
		}

		int[] c = new int[n];
		int[] d = new int[n];
		for (int i = 0; i < n - 1; i++) {
			c[i] = a[i + 1] - a[i];
			d[i] = b[i + 1] - b[i];
		}
		c[n - 1] = L - a[n - 1];
		d[n - 1] = L - b[n - 1];

		ArrayList<Integer> distancesC = fillIndices(c, n);
		ArrayList<Integer> distancesD = fillIndices(d, n);
		int cmax = distancesC.get(0);
		int dmax = distancesD.get(0);
		if (cmax != dmax) {
			System.out.println("NO");
			return;
		}

		outer: for (int maxDist : distancesC) {
			for (int i = 0; i < n; i++) {
				if (c[(maxDist + i) % n] != d[(distancesD.get(0) + i) % n]) {
					continue outer;
				}
			}
			System.out.println("YES");
			return;

		}
		System.out.println("NO");
	}

	static ArrayList<Integer> fillIndices(int[] arr, int n) {
		int cmax = 0;
		ArrayList<Integer> list = new ArrayList<>();
		for (int i = 0; i < n; i++) {
			if (cmax < arr[i]) {
				cmax = arr[i];
				list = new ArrayList<>();
			}
			if (cmax == arr[i]) {
				list.add(i);
			}
		}
		return list;
	}

}


import java.util.*;

public class main {

 	public static void main(String[] args) {

		Scanner in = new Scanner(System.in);
	    int  n =in.nextInt();
	    int m = in.nextInt();
        int count1 = 0,count2=0;
        int sum=0;
        int i=1;
	    while(n>0&&m>0){
	        sum+=i;
	        if(i%2==0&&m>i){
	            m = m-i;
	            count2++;
	        }
	        if(i%2!=0&&n>i){
	            n = n-i;
	            count1++;
	        }
	    }
	    if (count1>count2) System.out.print("Valera");
	    else System.out.print("Vladik");

	}

}


package problem;

public class Problem {
    public static final int[] p = {2,7,2,3,3,4,2,5,1,2};
    public static void main(String[] args) {
        java.util.Scanner input = new java.util.Scanner(System.in);
       int r = input.nextByte();
       int n0 = r/10; int n = r%10;
       System.out.println(p[n0]*p[n]);
    }
}


import java.util.Scanner;

public class Problem610A {

    public static  void main(String[] args){

        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        if(n < 1 || n >2000000000){
            return;
        }
        int[] tab = new int[n];

        int count = 0;

        for(int i = 1; i < n/2 - i; i++){

            count ++;
        }

        System.out.print(count);
    }
}