import java.util.*;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author jtimv
 */
public class D {

    class IntPair {

        int f, s;

        IntPair(int x, int y) {
            f = x;
            s = y;
        }
    }
    Scanner in = new Scanner(System.in);

    public static void main(String[] args) {
        new D().main();
    }
    int n, d, dsq;
    int[][] vectors;

    int len(int i) {
        return vectors[i][0] * vectors[i][0] + vectors[i][1] * vectors[i][1];
    }

    void inputVectors() {
        vectors = new int[n][2];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < 2; j++) {
                vectors[i][j] = in.nextInt();
            }
        }
        for (int i = 0; i < n - 1; i++) {
            for (int j = i + 1; j < n; j++) {
                if (len(j) > len(i)) {
                    int tmp = vectors[i][0];
                    vectors[i][0] = vectors[j][0];
                    vectors[j][0] = tmp;
                    tmp = vectors[i][1];
                    vectors[i][1] = vectors[j][1];
                    vectors[j][1] = tmp;
                }
            }
        }
    }

    boolean badPoint(IntPair pos) {
        return pos.f * pos.f + pos.s * pos.s > dsq;
    }

    boolean f(IntPair pos) {
        if (calculated.contains(pos)) {
            return calc[pos.f + 500][pos.s + 500];
        }

        if (badPoint(pos)) {
            calculated.add(pos);
            calc[pos.f + 500][pos.s + 500] = false;
            return false;
        }

        boolean res = true;
        for (int i = 0; i < n; i++) {
            IntPair nextPos = new IntPair(pos.f + vectors[i][0], pos.s + vectors[i][1]);
            if (f(nextPos)) {
                calculated.add(pos);
                calc[pos.f + 500][pos.s + 500] = false;
                return false;
            }
        }
        calculated.add(pos);
        calc[pos.f + 500][pos.s + 500] = true;
        return true;
    }
    boolean[][] calc = new boolean[1000][1000];
    Set<IntPair> calculated = new HashSet<IntPair>();

    void main() {
        int x = in.nextInt(), y = in.nextInt();
        n = in.nextInt();
        d = in.nextInt();
        dsq = d * d;
        inputVectors();
        System.out.println(!f(new IntPair(x, y)) ? "Anton" : "Dasha");
    }
}


import java.awt.Point;
import java.io.*;
import java.math.BigInteger;
import java.util.*;
import static java.lang.Math.*;

public class BetaRound63_Div2_D implements Runnable {

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

	public static void main(String[] args) {
		new Thread(null, new BetaRound63_Div2_D(), "", 256 * (1L << 20)).start();
	}

	public void run() {
		try {
			long t1 = System.currentTimeMillis();
			if (System.getProperty("ONLINE_JUDGE") != null) {
				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");
			}
			Locale.setDefault(Locale.US);
			solve();
			in.close();
			out.close();
			long t2 = System.currentTimeMillis();
			System.err.println("Time = " + (t2 - t1));
		} catch (Throwable t) {
			t.printStackTrace(System.err);
			System.exit(-1);
		}
	}

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

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

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

	double readDouble() throws IOException {
		return Double.parseDouble(readString());
	}

	// solution

	final int shift = 401, size = 2*shift + 1;

	int sx, sy, n, d;
	int[] vx, vy;

	boolean[][][][] dp;
	boolean[][][][] vis;

	boolean ok(int x, int y) {
		return (x - sx) * (x - sx) + (y - sy) * (y - sy) > d * d;
	}

	int get(int x, int y, int used1, int used2) {
		if (ok(x, y)) {
			return true;
		}
		if (vis[used1][used2][x][y]) {
			return dp[used1][used2][x][y];
		}

		boolean result = false;
		if (used1 == 0) {
			result |= !get(y, x, used2, 1);
		}
		for (int i = 0; i < n; i++) {
			result |= !get(x + vx[i], y + vy[i], used2, used1);
		}

		vis[used1][used2][x][y] = true;
		return dp[used1][used2][x][y] = result;
	}

	void solve() throws IOException {
		sx = readInt() + shift;
		sy = readInt() + shift;
		n = readInt();
		d = readInt();
		vx = new int[n];
		vy = new int[n];
		for (int i = 0; i < n; i++) {
			vx[i] = readInt() + shift;
			vy[i] = readInt() + shift;
		}
		// used 1, used 2, x, y
		dp = new boolean[2][2][size][size];
		boolean ans = get(x, y, 0, 0);
		out.println(ans ? "Anton" : "Dasha");
	}

}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.OutputStream;
import java.util.StringTokenizer;
import java.io.Writer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

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

    static class ProblemDPickingStrings {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            String S = in.next();
            String T = in.next();
            int Q = in.nextInt();
            int[] a = new int[S.length() + 1];
            int[] b = new int[T.length() + 1];
            for (int i = 0; i < S.length(); i++) {
                if (S.charAt(i) == 'A') {
                    a[i + 1] = a[i] + 1;
                }
            }
            for (int i = 0; i < T.length(); i++) {
                if (T.charAt(i) == 'A') {
                    b[i + 1] = b[i] + 1;
                }
            }
            int[] c = new int[S.length() + 1];
            int[] d = new int[T.length() + 1];
            for (int i = 0; i < S.length(); i++) {
                c[i + 1] = c[i] + (S.charAt(i) != 'A' ? 1 : 0);
            }
            for (int i = 0; i < T.length(); i++) {
                d[i + 1] = d[i] + (T.charAt(i) != 'A' ? 1 : 0);
            }
            while (Q-- > 0) {
                int a1 = in.nextInt(), b1 = in.nextInt(), a2 = in.nextInt(), b2 = in.nextInt();
                boolean ok = false;
                int k1 = Math.min(b1 - a1 + 1, a[b1]);
                int k2 = Math.min(b2 - a2 + 1, b[b2]);
                int v1 = c[b1] - c[a1 - 1];
                int v2 = d[b2] - d[a2 - 1];
                if (v1 % 2 == v2 % 2 && k1 >= k2) {
                    if (k1 % 3 != k2 % 3) v1 += 2;
                    if (v1 <= v2) {
                        if (v1 != 0 || v2 == 0 || b1 - a1 + 1 > k1) {
                            ok = true;
                        }
                    }
                }
            /*if (k1 >= k2) {

                if ((k1 - k2) % 3 != 0) v1 += 2;
                if (v1 == v2) ok = true;
                if ((v1 < v2) && (v2 - v1) % 2 == 0) {
                    if (v1 > 0 || k1 < b1 - a1 + 1) ok = true;
                }
            }*/
                if (ok) {
                    out.print(1);
                } else {
                    out.print(0);
                }
            }
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }

    static class OutputWriter extends PrintWriter {
        public OutputWriter(OutputStream out) {
            super(out);
        }

        public OutputWriter(Writer out) {
            super(out);
        }

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

    }
}


import java.io.BufferedWriter;
import java.util.InputMismatchException;
import java.util.NoSuchElementException;
import java.math.BigInteger;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.io.IOException;
import java.util.Arrays;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
import java.io.OutputStreamWriter;
import java.io.PrintStream;
import java.util.Set;

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

class TaskG {

    long INF= (long) 1e17;
    public void solve(int testNumber, MyScanner in, MyPrintWriter out) {
        long s = in.nextLong();
        long res = 0;
        for (int l = 0; l <= 55; l++)
            for (int r = 0; r <= 55; r++) {
                long L=0,R=INF;
                while(R-L>1){
long min=0;
                    long max=0;
                    long m = (R+L)/2;

                    min += m;
                    long v=m*2;
                    for(int i=0;i<l;i++){
                        min = Math.min(min + v, INF);
                        v = Math.min(v * 2, INF);
                    }
                    v=m*2+1;
                    for(int i=0;i<r;i++){
                        min = Math.min(min + v, INF);
                        v = Math.min(v * 2, INF);
                    }

                    max += m;
                    v=m*2;
                    for(int i=0;i<l;i++){
                        max = Math.min(max + v, INF);
                        v = Math.min(v * 2 + 1, INF);
                    }
                    v=m*2+1;
                    for(int i=0;i<r;i++){
                        max = Math.min(max + v, INF);
                        v = Math.min(v * 2 + 1, INF);
                    }
                    if (s < min) {
                        R = m;
                    } else if (s > max) {
                        L = m;
                    } else {
                        res += solve(s - min,l,r);
                        break;
                    }
                }
            }
        out.println(res);
    }

    private long solve(long s, int l, int r) {
        l = Math.max(l-1, 0);
        r = Math.max(r-1, 0);
        long[] cand = new long[l + r];
        for(int i=0;i<l;i++)cand[i] = (1L << l) - 1;
        for(int i=0;i<r;i++)cand[l + i] = (1L << r) - 1;
        Arrays.sort(cand);
        HashMap<Long, Long> cur = new HashMap<>();
        cur.put(0L, 1L);
        for(int i=cand.length-1;i>=0;i--) {
            HashMap<Long, Long> nxt = new HashMap<>();
            long c = cand[i];
            long rest = 0;
            for(int j=0;j<i;j++)rest += cand[i];
            for(Map.Entry<Long, Long> e : cur.entrySet()) {
                long val = e.getKey();
                if (val + c <= s) {
                    if(!nxt.containsKey(val+c)){
                        nxt.put(val+c, 1L);
                    } else{
                        nxt.put(val+c, nxt.get(val+c) + 1);
                    }
                }
                if (val + rest >= s) {
                    if(!nxt.containsKey(val)){
                        nxt.put(val, 1L);
                    } else{
                        nxt.put(val, nxt.get(val) + 1);
                    }
                }
            }
            cur = nxt;
        }
        return cur.get(s);
    }

}

class MyScanner {
    private final InputStream in;

    public MyScanner(InputStream in) {
        this.in = in;
    }

    private static final int BUFSIZE = 65536;
    int bufLen;
    int bufPtr;
    byte[] buf = new byte[BUFSIZE];

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

    public long nextLong() {
        int c = read();
        if (c == -1) throw new NoSuchElementException();
        while (c != '-' && (c < '0' || '9' < c)) {
            c = read();
            if (c == -1) throw new NoSuchElementException();
        }
        if (c == '-') return -nextLong();
        long res = 0;
        do {
            res *= 10;
            res += c - '0';
            c = read();
        } while ('0' <= c && c <= '9');
        return res;
    }

}

class MyPrintWriter {
    PrintWriter out;

    public MyPrintWriter(OutputStream outputStream) {
        out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public void println(Object... os) {
        if (os.length == 0) {
            out.println();
            return;
        }
        for (int i = 0; i < os.length - 1; i++) {
            out.print(os[i]);
            out.print(' ');
        }
        out.println(os[os.length - 1]);
    }

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

}


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

public class Main {

	Input in;
	PrintWriter out;

	final static int INF = (int) 1e9;
	final static int MOD = (int) 1e9 + 7;
	final static long LINF = (long) 1e18;
	final static double PI = (double) Math.acos(-1.0);
	final static double EPS = (double) 1e-9;

	void solve() {
		long x = in.nextLong();
		long ans = 0;
		for (int k = 0; k <= 50; k++) {
			for (int l = 0; l <= 50; l++) {
				long m = (1L << (k + 1)) + (1L << (l + 1)) - 3;
				long y = x - (1L << l) + 1;
				if (y < m) continue;
				for (int tot = 0; tot <= k + l; tot++) {
					long tmp = (y + tot) % m;
					if (tmp > (1L << k) + (1L << l) - 2) {
						continue;
					}
					int[] digit = new int[50];
					int cnt = 0;
					while (tmp > 0) {
						digit[cnt++] = (int) (tmp % 2);
						tmp >>= 1;
					}
					if (tot > 2 * cnt) continue;
					long[][][] dp = new long[cnt + 1][2 * cnt + 1][2];
					dp[0][0][0] = 1;
					for (int pos = 0; pos < cnt; pos++) {
						for (int sum = 0; sum <= tot; sum++) {
							for (int car = 0; car < 2; car++) if (dp[pos][sum][car] != 0) {
								int lox = 0, hix = 1;
								int loy = 0, hiy = 1;
								if (pos >= k || pos == 0) hix = 0;
								if (pos >= l || pos == 0) hiy = 0;
								for (int i = lox; i <= hix; i++) {
									for (int j = loy; j <= hiy; j++) {
										int u = i + j + car;
										if (u % 2 == digit[pos]) {
											dp[pos + 1][sum + i + j][u / 2] += dp[pos][sum][car];
										}
									}
								}
							}
						}
					}
					ans += dp[cnt][tot][0];
				}
			}
		}
		out.println(ans);
	}

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

	public void run() {
		in = new Input();
		try {
			out = new PrintWriter(System.out);
			//out = new PrintWriter(new FileWriter("a.out"));
		}
		catch (Exception ex) {
		}
		long stime = System.currentTimeMillis();
		solve();
		if (System.getProperty("ONLINE_JUDGE") == null) {
			out.println("\nTime elapsed: " + (System.currentTimeMillis() - stime) + "ms");
		}
		out.close();
	}

	public class Input {
		StringTokenizer token = null;
		BufferedReader in;
		public Input() {
			try {
				if (System.getProperty("ONLINE_JUDGE") == null) {
					in = new BufferedReader(new InputStreamReader(System.in));
					//in = new BufferedReader(new FileReader("in.txt"));
				}
				else {
					in = new BufferedReader(new InputStreamReader(System.in));
				}
			}
			catch (Exception ex) {
			}
		}
		int nextInt() {
			return Integer.parseInt(nextString());
		}
		long nextLong() {
			return Long.parseLong(nextString());
		}
		double nextDouble() {
			return Double.parseDouble(nextString());
		}
		String nextString() {
			try {
				while (token == null || !token.hasMoreTokens()) {
					token = new StringTokenizer(in.readLine());
				}
			}
			catch (IOException e) {
			}
			return token.nextToken();
		}
	}
}


import java.io.*;
import java.util.*;
public class Solution{
    static long requiredB;
    static long requiredS;
    static long requiredC;

    static long haveB;
    static long haveS;
    static long haveC;

    static long priceB;
    static long priceS;
    static long priceC;

    static long money;
    static boolean canMake(int m){
        long b1=requiredB*m;
        long s1=requiredS*m;
        long c1=requiredC*m;

        long toBuyB = Math.abs(b1 - haveB);
        if(b1 <= haveB)
        toBuyB = 0;

        long toBuyS = Math.abs(s1 - haveS);
        if(s1 <= haveS)
            toBuyS = 0;

        long toBuyC = Math.abs(c1 - haveC);
        if(c1 <= haveC)
            toBuyC = 0;

        long moneyNeed = (priceB * toBuyB) +  (priceS * toBuyS) +  (priceC * toBuyC);

        if(moneyNeed > money)
            return false;
        else
            return true;

    }
    static long search(){

        long low = 0;
        long high = Long.parseLong("900000000000000");
        long ans = 0;
        while(low <= high){
            long mid = low + (high - low)/2;
            if(canMake(mid)){
                ans = mid;
                low = mid + 1;
            }
            else {
                high = mid - 1;
            }
        }

        return ans;

    }

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

        HashMap<Character,Integer> hm = new HashMap<>();
        hm.put('B',0);
        hm.put('S',0);
        hm.put('C',0);

        for(char c : s.toCharArray()){
            if(hm.containsKey(c)){
                hm.put(c,hm.get(c)+1);
            }

        }

        requiredB = hm.get('B');
        requiredS = hm.get('S');
        requiredC = hm.get('C');

        String in[] = br.readLine().trim().split(" ");
        haveB = Long.parseLong(in[0]);
        haveS = Long.parseLong(in[1]);
        haveC = Long.parseLong(in[2]);

        in = br.readLine().trim().split(" ");
        priceB = Long.parseLong(in[0]);
        priceS = Long.parseLong(in[1]);
        priceC = Long.parseLong(in[2]);

        money = Long.parseLong(br.readLine().trim());
        System.out.println(search());
    }
}


import java.io.*;
import java.util.StringTokenizer;
public class Main {
    static PrintWriter pw=new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
    public static void main(String[] args) throws IOException {
        BufferedReader bf=new BufferedReader(new InputStreamReader( System.in));
        StringTokenizer tk=new StringTokenizer(bf.readLine());
        int t2=Integer.parseInt(tk.nextToken());
        int t3=Integer.parseInt(tk.nextToken());
        int t5=Integer.parseInt(tk.nextToken());
        int t6=Integer.parseInt(tk.nextToken());
        int sol=0;
        while (t2>0){
            if(t2>=1 && t5>=1 && t6>=1){
                sol+=256;
                t2--;
                t5--;
                t6--;
            }
            if(t3>=1 && t2>=1){
                sol+=32;
                t3--;
                t2--;
            }
            if (t2==0)break;
        }
        pw.write(sol+"");
        pw.flush(); }


public class Main {

    public static void main(String[] args) {
        Scanner newSc = new Scanner(System.in);
        int a = newSc.nextInt();
        int b = newSc.nextInt();
        int c = newSc.nextInt();
        int ans = 0;
        for(int i = 0;i < c;i += 1){
            ans += 2 * (a - 4 * i) + 2 * (b - 4 * i) - 4;
        }
        System.out.println(ans);
    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintStream;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.io.Closeable;
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) throws Exception {
        Thread thread = new Thread(null, new TaskAdapter(), "", 1 << 27);
        thread.start();
        thread.join();
    }

    static class TaskAdapter implements Runnable {
        @Override
        public void run() {
            InputStream inputStream = System.in;
            OutputStream outputStream = System.out;
            FastInput in = new FastInput(inputStream);
            FastOutput out = new FastOutput(outputStream);
            DPaths solver = new DPaths();
            solver.solve(1, in, out);
            out.close();
        }
    }

    static class DPaths {
        Debug debug = new Debug(true);

        public void solve(int testNumber, FastInput in, FastOutput out) {
            int n = in.readInt();
            MultiplicativeFunctionSieve sieve = new MultiplicativeFunctionSieve(n, false, true, false);

            long twoCnt = 0;
            long threeCnt = 0;
            int[] ps = new int[n + 1];
            for (int i = 2; i <= n; i++) {
                ps[sieve.smallestPrimeFactor[i]]++;
            }
            for (int i = 1; i <= n; i++) {
                ps[i] += ps[i - 1];
            }
            for (int i = 1; i * 2 <= n; i++) {
                int num = (ps[i] - ps[i - 1]);

                int j = Math.min(i - 1, n / i);
                twoCnt += (long) ps[j] * num;

                int k = Math.min(i - 1, n / 2);
                threeCnt += (long) ps[k] * num;
            }
            for (int i = 1; i <= n; i++) {
                int num = ps[i] - ps[i - 1];
                if (i * i <= n) {
                    twoCnt += num * (num - 1) / 2;
                }
                if (i * 2 <= n) {
                    threeCnt += num * (num - 1) / 2;
                }
            }

            threeCnt -= twoCnt;
            long coprime = 0;
            for (int i = 2; i <= n; i++) {
                coprime += sieve.euler[i];
            }

            long notCoprime = (long) n * (n - 1) / 2 - coprime;
            long ans = twoCnt * 2 - notCoprime + threeCnt * 3;

            debug.debug("coprime", coprime);
            debug.debug("twoCnt", twoCnt);
            debug.debug("notCporime", notCoprime);
            debug.debug("threeCnt", threeCnt);
            out.println(ans);
        }

    }

    static class Debug {
        private boolean offline;
        private PrintStream out = System.err;

        public Debug(boolean enable) {
            offline = enable && System.getSecurityManager() == null;
        }

        public Debug debug(String name, long x) {
            if (offline) {
                debug(name, "" + x);
            }
            return this;
        }

        public Debug debug(String name, String x) {
            if (offline) {
                out.printf("%s=%s", name, x);
                out.println();
            }
            return this;
        }

    }

    static class FastInput {
        private final InputStream is;
        private byte[] buf = new byte[1 << 13];
        private int bufLen;
        private int bufOffset;
        private int next;

        public FastInput(InputStream is) {
            this.is = is;
        }

        private int read() {
            while (bufLen == bufOffset) {
                bufOffset = 0;
                try {
                    bufLen = is.read(buf);
                } catch (IOException e) {
                    bufLen = -1;
                }
                if (bufLen == -1) {
                    return -1;
                }
            }
            return buf[bufOffset++];
        }

        public void skipBlank() {
            while (next >= 0 && next <= 32) {
                next = read();
            }
        }

        public int readInt() {
            int sign = 1;

            skipBlank();
            if (next == '+' || next == '-') {
                sign = next == '+' ? 1 : -1;
                next = read();
            }

            int val = 0;
            if (sign == 1) {
                while (next >= '0' && next <= '9') {
                    val = val * 10 + next - '0';
                    next = read();
                }
            } else {
                while (next >= '0' && next <= '9') {
                    val = val * 10 - next + '0';
                    next = read();
                }
            }

            return val;
        }

    }

    static class FastOutput implements AutoCloseable, Closeable, Appendable {
        private StringBuilder cache = new StringBuilder(10 << 20);
        private final Writer os;

        public FastOutput append(CharSequence csq) {
            cache.append(csq);
            return this;
        }

        public FastOutput append(CharSequence csq, int start, int end) {
            cache.append(csq, start, end);
            return this;
        }

        public FastOutput(Writer os) {
            this.os = os;
        }

        public FastOutput(OutputStream os) {
            this(new OutputStreamWriter(os));
        }

        public FastOutput append(char c) {
            cache.append(c);
            return this;
        }

        public FastOutput append(long c) {
            cache.append(c);
            return this;
        }

        public FastOutput println(long c) {
            return append(c).println();
        }

        public FastOutput println() {
            cache.append(System.lineSeparator());
            return this;
        }

        public FastOutput flush() {
            try {
                os.append(cache);
                os.flush();
                cache.setLength(0);
            } catch (IOException e) {
                throw new UncheckedIOException(e);
            }
            return this;
        }

        public void close() {
            flush();
            try {
                os.close();
            } catch (IOException e) {
                throw new UncheckedIOException(e);
            }
        }

        public String toString() {
            return cache.toString();
        }

    }

    static class MultiplicativeFunctionSieve {
        public int[] primes;
        public boolean[] isComp;
        public int primeLength;
        public int[] mobius;
        public int[] euler;
        public int[] factors;
        public int[] smallestPrimeFactor;
        public int[] numberOfSmallestPrimeFactor;

        public MultiplicativeFunctionSieve(int limit, boolean enableMobius, boolean enableEuler, boolean enableFactors) {
            isComp = new boolean[limit + 1];
            primes = new int[limit + 1];
            numberOfSmallestPrimeFactor = new int[limit + 1];
            smallestPrimeFactor = new int[limit + 1];
            primeLength = 0;
            for (int i = 2; i <= limit; i++) {
                if (!isComp[i]) {
                    primes[primeLength++] = i;
                    numberOfSmallestPrimeFactor[i] = smallestPrimeFactor[i] = i;
                }
                for (int j = 0, until = limit / i; j < primeLength && primes[j] <= until; j++) {
                    int pi = primes[j] * i;
                    smallestPrimeFactor[pi] = primes[j];
                    numberOfSmallestPrimeFactor[pi] = smallestPrimeFactor[i] == primes[j]
                            ? (numberOfSmallestPrimeFactor[i] * numberOfSmallestPrimeFactor[primes[j]])
                            : numberOfSmallestPrimeFactor[primes[j]];
                    isComp[pi] = true;
                    if (i % primes[j] == 0) {
                        break;
                    }
                }
            }

            if (enableMobius) {
                mobius = new int[limit + 1];
                mobius[1] = 1;
                for (int i = 2; i <= limit; i++) {
                    if (!isComp[i]) {
                        mobius[i] = -1;
                    } else {
                        if (numberOfSmallestPrimeFactor[i] != smallestPrimeFactor[i]) {
                            mobius[i] = 0;
                        } else {
                            mobius[i] = mobius[numberOfSmallestPrimeFactor[i]] * mobius[i / numberOfSmallestPrimeFactor[i]];
                        }
                    }
                }
            }

            if (enableEuler) {
                euler = new int[limit + 1];
                euler[1] = 1;
                for (int i = 2; i <= limit; i++) {
                    if (!isComp[i]) {
                        euler[i] = i - 1;
                    } else {
                        if (numberOfSmallestPrimeFactor[i] == i) {
                            euler[i] = i - i / smallestPrimeFactor[i];
                        } else {
                            euler[i] = euler[numberOfSmallestPrimeFactor[i]] * euler[i / numberOfSmallestPrimeFactor[i]];
                        }
                    }
                }
            }

            if (enableFactors) {
                factors = new int[limit + 1];
                factors[1] = 1;
                for (int i = 2; i <= limit; i++) {
                    if (!isComp[i]) {
                        factors[i] = 2;
                    } else {
                        if (numberOfSmallestPrimeFactor[i] == i) {
                            factors[i] = 1 + factors[i / smallestPrimeFactor[i]];
                        } else {
                            factors[i] = factors[numberOfSmallestPrimeFactor[i]]
                                    * factors[i / numberOfSmallestPrimeFactor[i]];
                        }
                    }
                }
            }
        }

    }
}


import java.util.*;
public class d {
	public static void main(String[] arg) {
		new d();
	}
	public d() {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int[] smallestPrime = new int[n+1];
		boolean[] isPrime = new boolean[n+1];
		Arrays.fill(isPrime, true);
		isPrime[0] = isPrime[1] = false;
		for(int i = 2; i < isPrime.length; i++) {
			if(isPrime[i]) {
				smallestPrime[i] = i;
				for(int j = i+i; j < isPrime.length; j+=i) {
					isPrime[j] = false;
					if(smallestPrime[j] == 0) smallestPrime[j] = i;
				}
			}
		}
		long[] numP = new long[n+1];
		for(int i = 2; i <= n; i++) {
			numP[smallestPrime[i]]++;
		}
		long[] cum = new long[n+1];
		cum[0] = numP[0];
		for(int i = 1; i <= n; i++) {
			cum[i] += cum[i-1]+numP[i];
		}
		long ans = 0;
		for(int i = 2; i <= n; i++) {
			int p = smallestPrime[i];
			int other = i/p;
			if(isPrime[other] && other > p) {
//				System.out.println(i + " " + other + " " + numP[p] + " " + numP[other]);
				long temp = numP[p]*numP[other];
				for(int j = p; j <= n; j+=p) {
					if(j%other == 0 && smallestPrime[j] == p) temp -= numP[other];
				}
				ans += 2*temp;
			}
		}
		outer:
		for(int i = 2; i <= n; i++) {
			long count = 0;
			int sign = -1;
			int x = i;
			while(x > 1) {
				int y = smallestPrime[x];
				x /= y;
				if(smallestPrime[x] == y) {
					continue outer;
				}
				sign *= -1;
			}
			for(int j = i; j <= n; j += i) {
				count++;
			}
			ans += sign*(count*(count-1)/2);
		}
		for(int i = 2; i <= n; i++) {
			if(!isPrime[i]) continue;
			if(n/i < i) continue;
			ans += numP[i]*(cum[n/2]-cum[n/i])*3;
		}
		System.out.println(ans);
	}
}


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

public class Main {

    InputReader ir = new InputReader(System.in);
    PrintWriter out = new PrintWriter(System.out);
    long mem[][];
    long mod = 1000000007;
    int n;
    int range;
    void solve() {
        range = ir.readInt();
        n = ir.readInt();
        mem = new long[1001][1001];
        for(int i = 0; i < 1001; i++)
            Arrays.fill(mem[i], -1);
        long ans = 0;
        for(int i = 1; i <= range; i++)
        ans = (ans + rec(0, i))%mod;;
        out.println(ans);
    }
    int rec(int idx, int l) {
        if(idx == n - 1)
            return 1;
        if(mem[idx][l] != -1)
            return (int)mem[idx][l];
        long ans = 0;
        for(int i = l; i <= range; i += l) {
            ans = (ans + (rec(idx + 1, i)))%mod;
        }
        mem[idx][l] = ans;
        return (int)ans;
    }
    void run() {
        solve();
        out.close();
    }
    public static void main(String args[]){
        new Main().run();
    }
}

class InputReader {

    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
    private 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 final int readInt() {
            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 long readLong() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long 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 readString() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        StringBuilder res = new StringBuilder();
        do {
            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 double readDouble() {
        return Double.parseDouble(readString());
    }

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

    public String next() {
        return readString();
    }

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


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

public class abcd
{

	public static void main (String[] args) throws java.lang.Exception
	{

		// yo
Scanner s=new Scanner(System.in);
  int k=s.nextInt();
  int r=s.nextInt();
  boolean flag=true;
  if(k%10==0){
      System.out.println("1");
      flag=false;
  }
  else if(k%5==0&&flag){
        System.out.println("2");

  }
  else{
  int i=1;
  int d=-1;
  int l=r;
if(k%10==l){
    System.out.println(i);
}else{
  while(d!=r){
      d=(k*i)%10;
      i++;
  }System.out.println(i-1);
}

}
}

}


import java.util.Scanner;
import java.util.Arrays;
public class JavaApplication18 {
    public static void main(String[] args) {
   Scanner s=new Scanner(System.in);
   int n=s.nextInt();
   int c=0,m;
   m=(n-1)/2;
   int arr[][]=new int[n][n];
    for(int i=0;i<n;i++)
   {
       for(int j=0;j<n;j++)
       arr[i][j]=s,nextInt();
   }
   for(int i=0;i<n;i++)
   {
       for(int j=0;j<n;j++)
       {
           if(i==j||j==0||i==m||j==m||i+j<n-1)
           c+=arr[i][j];
           }
   }
       System.out.print(c);

}
}


public class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner s1= new Scanner(System.in);
		int n=s1.nextInt();
		int a[][]= new int[n][n];
		for(int i=0;i<n;i++)
		{
		    for(int j=0;j<n;j++)
		    {
		        a[i][j]=s1.nextInt();
		    }
		}
		int s=0;
		for(int i=0;i<n;i++)
		{
		    for(int j=0;j<n;j++)
		    {
		        if(i==j)
		        {
		            s+=a[i][j];
		        }
		        if(i+j==n-1)
		        {
		            s+=a[i][j];
		        }
		        if(i<n && j==n/2)
		        {
		            s+=a[i][j];
		        }
		        if(j<n && i==n/2)
		        {
		            s+=a[i][j];
		        }
		    }
		}
		int c=a[n/2][n/2];
		System.out.println(s-(c*3));

	}
}


import java.util.Scanner;

public class SoalA {
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		String kata = input.next();

		int limit = 0;
		int counter=1;

		for(int i = 0; i < kata.length() - 1; i++) {
			if(kata.charAt(i) == kata.charAt(i+1)) {
				limit += 1;
				if(limit == 5) {
					counter++;
					limit = 0;
				}
			}
			else {
				counter++;
			}
		}
		}
		System.out.println(counter);
	}
}


package pkg800;

import java.util.Scanner;

public class Elephant {

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

        int input = scanner.nextInt();

        if (input % 5 == 0) {
            System.out.println(input / 5);
        }
        else {
            System.out.println((input / 5) + 1);
        }
    }
}


public class Main {

	public static void main(String arg[]){

		int n;
		Scanner cin=new Scanner(System.in);
		n=cin.nextInt();

		int a[]=new int[n];
		for(int i=0;i<n;i++){
			a[i]=cin.nextInt();
		}

		Arrays.sort(a);

		int sum=0;
		for(int i=0;i<n;i+=2){
			sum+=a[i+1]-a[i];
		}
		System.out.println(sum);
		//System.out.println("Hello wrld");
	}

}


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

public class A {

    public static void main(String[] args) {

        System.out.println(canJump(System.in));
    }

    public static String canJump(InputStream stream){

        try {
            BufferedReader br = new BufferedReader(new InputStreamReader(stream));

            String nk = br.readLine();
            String[] nks= nk.split(" ");
            int n = Integer.parseInt(nks[0]);
            int k = Integer.parseInt(nks[1]);
            String data = br.readLine();
            char[] d = data.toCharArray();

            int g_i = -1;
            int t_i = -1;

            for (int i = 0; i < d.length; i++) {
                if(d[i] == 'G') t_i = i;
                if(d[i] == 'T') t_i = i;
            }

            if(g_i > t_i){
                if(g_i - k < 0) return "NO";
                else{
                    while(g_i >= t_i){
                        if(g_i == t_i) return "YES";
                        if(d[g_i - k] == '.') g_i -= k;
                        if(d[g_i - k] == '#') return "NO";
                    }
                }
            }
            else{
                if(g_i + k >= d.length) return "NO";
                else{
                    while(g_i <= t_i){
                        if(g_i == t_i) return "YES";
                        if(d[g_i + k] == '.') g_i -= k;
                        if(d[g_i + k] == '#') return "NO";
                    }
                }
            }

            return "NO";
        }

        catch (IOException e){
            e.printStackTrace();
            return "NO";
        }
    }
}


import java.util.Scanner;

public class demo {
    static int [] odd;
    static int curOdd = 0;
    static int [] even;
    static int curEven = 0;
    public static void main(String [] args) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        odd = new int[n];
        even = new int[n];
        // تو فوران روز ، یه لبخند خاموشم
        for(int i = 1 ; i <= n ; i += 2){
            odd[curOdd] = i;
            curOdd++;
        }
        for(int i = 2 ; i <= n ; i += 2){
            even[curEven] = i;
            curEven++;
        }
        if(n % 2 == 0){
            for(int i = 0 ; i < curEven ; i++) {
                if (even[i] == n) {
                    if (i % 2 == 0) {
                        System.out.println(1);
                        return;
                    } else {
                        System.out.println(0);
                        return;
                    }
                }
            }
        }else{
            for(int i = 0 ; i < curOdd ; i++) {
                if (odd[i] == n) {
                    if (i % 2 == 0) {
                        System.out.println(1);
                        return;
                    } else {
                        System.out.println(0);
                        return;
                    }
                }
            }
        }
    }
}


import java.util.*;

public class methodOne{
	public static void flowersAndChocolate() {
		Scanner s=new Scanner(System.in);
		int n=s.nextInt();
		int k=s.nextInt();
		if(k%2==0 || k>=2*n){
			System.out.println("-1");
		}
		else{
			if(n==1){
				System.out.println("1");
			}
			else{
				int []array=new int[n];
				merge(0,n,k,array,1);
				System.out.print(array[0]);
				for (int i =1; i <n; i++) {
					System.out.print(" "+array[i]);
				}

			}
		}
	}

	public static void merge(int start,int end,int k,int[]a,int num){
		if(k==1){
			for (int i =start; i <end; i++) {
				a[i]=num;
				num++;
			}
		}
		else{
			if(k>1 && start<end){
				k--;
				int temp1=k/2;
				int temp2=k-temp1;
				if(temp1%2==0){
					temp1--;
					temp2++;
				}
				int middle=(start+end)/2;
				merge(middle,end,temp2,a,num);
				merge(start,middle,temp1,a,num+end-middle);
			}
		}
	}
public static void main(){
	flowersAndChocolate();
}

}


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

public class methodOne {

	static final int P = 1_000_000_007;

	void submit() {
		int n = nextInt();
		int m = nextInt();
		long exp = nextLong();
		int[] a = new int[n];
		int[] b = new int[m];
		for (int i = 0; i < n; i++) {
			a[i] = nextInt();
		}
		int maxCoef = 0;
		for (int i = 0; i < m; i++) {
			b[i] = nextInt();
			maxCoef = Math.max(maxCoef, b[i]);
		}

		int[] bPoly = new int[maxCoef + 1];
		bPoly[maxCoef] = 1;
		for (int pow : b) {
			bPoly[maxCoef - pow]--;
			if (bPoly[maxCoef - pow] < 0) {
				bPoly[maxCoef - pow] += P;
			}
		}

		int[] aPoly = {};
		for (int pow : a) {
			aPoly = sum(aPoly, quotPow(new int[] { 0, 1 }, bPoly, pow));
		}
		int[] ans = quotPow(aPoly, bPoly, exp);

		ans = prod(ans, quotPow(new int[] { 0, 1 }, bPoly, maxCoef));
		ans = quot(ans, bPoly);

		out.println((long)ans[0] * inv(P - bPoly[0]) % P);
	}

	int inv(int x) {
		return x == 1 ? 1 : P - (int)((long)(P / x) * inv(P % x) % P);
	}

	int[] quotPow(int[] a, int[] b, long n) {
		a = quot(a, b);
		int[] ret = { 1 };
		for (; n > 0; n >>= 1) {
			if ((n & 1) == 1) {
				ret = quot(prod(ret, a), b);
			}
			a = quot(prod(a, a), b);
		}
		return ret;
	}

	int[] sum(int[] a, int[] b) {
		int[] c = Arrays.copyOf(a, Math.max(a.length, b.length));
		for (int i = 0; i < b.length; i++) {
			c[i] += b[i];
			if (c[i] >= P) {
				c[i] -= P;
			}
		}
		return c;
	}

	int[] prod(int[] a, int[] b) {
		int[] c = new int[a.length + b.length - 1];
		for (int i = 0; i < a.length; i++) {
			for (int j = 0; j < b.length; j++) {
				c[i + j] += (int) ((long) a[i] * b[j] % P);
				if (c[i + j] >= P) {
					c[i + j] -= P;
				}
			}
		}
		return c;
	}

	int[] quot(int[] a, int[] b) {
		a = a.clone();
		// leading coef of b is 1
		if (a.length < b.length) {
			return a;
		}
		int degB = b.length - 1;
		for (int ptr = a.length - 1; ptr >= degB; ptr--) {
			long coef = a[ptr];
			for (int i = 0, j = ptr - degB; i < degB; i++, j++) {
				a[j] -= (int) (coef * b[i] % P);
				if (a[j] < 0) {
					a[j] += P;
				}
			}
		}
		return Arrays.copyOf(a, degB);
	}

	void preCalc() {

	}

	void stress() {

	}

	void test() {

	}

	public static void methodOne() throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		preCalc();
		submit();
		out.close();
	}

	static final Random rng = new Random();

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

	BufferedReader br;
	PrintWriter out;
	StringTokenizer st;

	String nextToken() {
		while (st == null || !st.hasMoreTokens()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return st.nextToken();
	}

	String nextString() {
		try {
			return br.readLine();
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
	}

	int nextInt() {
		return Integer.parseInt(nextToken());
	}

	long nextLong() {
		return Long.parseLong(nextToken());
	}

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

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


public class TwoProblems {
    public static void main(String[] args) {
        try{
            BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
            String s = bf.readLine();
            int x,t,a,b,da,db;
            String[] inputs = s.split(" ");
            x = Integer.parseInt(inputs[0]);
            t = Integer.parseInt(inputs[1]);
            a = Integer.parseInt(inputs[2]);
            b = Integer.parseInt(inputs[3]);
            da = Integer.parseInt(inputs[4]);
            db = Integer.parseInt(inputs[5]);
            if(x==0)
                System.out.println("YES");
            else if(x==a||x==b)
                System.out.println("YES");
            else{
                int score = a+b;
                int i,j=0;
                for(i = 0;i<t;i++){
                    for(j = 0;j<t;j++){
                        score = a+b;
                        score-=(da*i);
                        score-=(db*j);
                        if(score==x)
                            break;
                    }
                    if(j<t)
                        break;
                }
                if((i==t)&&(j==t))
                    System.out.println("NO");
                else
                    System.out.println("YES");
            }
        }catch (Exception e) {
            e.printStackTrace();
        }
    }
}


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

public class Main {

    private void solve() {
        int w = nextInt();
        int h = nextInt();
        int k = nextInt();
        int kol=0;
        for (int i = 0; i < k; i++) {
            kol += (w*2+h*2)-4;
            w-=4;
            h-=4;
        }
        out.print();
    }
    public static void main(String[] args) {
        new Main().run();
    }

    BufferedReader br;
    StringTokenizer st;
    PrintWriter out;

    private void run() {
        try {
            br = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
            //br = new BufferedReader(new FileReader("birthday.in"));
            //out = new PrintWriter(new FileWriter("birthday.out"));
            solve();
            br.close();
            out.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

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

    private String next() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
                return "END_OF_FILE";
            }
        }
        return st.nextToken();
    }
}


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

public class Gennady {

private static final Scanner scanner = new Scanner(System.in);

    public static  boolean test(String x,char x1,char x2,int c1,int c2,String y){

             char y1 = y.charAt(0);
        char y2 = y.charAt(1);
        if(x1==y1 || x2==y2){
            c1++;
        }else{
            c2++;
        }

     if(c1 == 0){
            return false;
        }
            return true;

    }

    public static void main(String[] args){
        String x = scanner.nextLine();
          char x1 = x.charAt(0);
        char x2 = x.charAt(1);
        int c1,c2,c3;
        boolean ret = false;
        for(int i=0;i<5;i++){
              c1=0;
        c2=0;
        c3=0;
            String y = scanner.next();
         ret = test(x,x1,x2,c1,c2,y);
         if(ret==true){
             c3++;
         }
        }
        if(c3>0){
            System.out.println("YES");
        }else{
              System.out.println("NO");
        }
        }

    }


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

public class Div2_421C {

	public static void main(String[] args) throws IOException {
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer inputData = new StringTokenizer(reader.readLine());
		int a = Integer.parseInt(inputData.nextToken());
		int b = Integer.parseInt(inputData.nextToken());
		int l = Integer.parseInt(inputData.nextToken());
		int r = Integer.parseInt(inputData.nextToken());

		StringBuilder cString = new StringBuilder();
		for (int i = 0; i < a; i++) {
			cString.append((char) ('a' + i));
		}
		char last = cString.charAt(cString.length() - 1);
		for (int i = 0; i < b; i++) {
			cString.append(last);
		}
		TreeSet<Integer> used = new TreeSet<Integer>();
		for (char c : cString.substring(cString.length() - a, cString.length()).toCharArray()) {
			used.add(c - 'a');
		}

		int nxt = 0;
		for (int i = 0; i < a; i++) {
			while (used.contains(nxt)) {
				nxt++;
			}
			cString.append((char) ('a' + nxt));
			nxt++;
		}

		last = cString.charAt(cString.length() - 1);
		for (int i = 0; i < b; i++) {
			cString.append(last);
		}

		int len = cString.length();

		used.clear();
		if (r - l + 1 >= len) {
			for (char c : cString.toString().toCharArray()) {
				used.add(c - 'a');
			}
		} else {
			for (int i = l; i != (r + 1) % len; i = (i + 1) % len) {
				used.add(cString.charAt(i) - 'a');
			}
		}
		System.out.println(used.size());
	}

}


//package fb1;

//package fb1;

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

public class MainA {

	public static int mod = 20000;
	public static long[] val;
	public static long[] arr;
	static long max = (long) 1e10 + 7;
	static long count=0;

	public static void main(String[] args) {

		InputReader in = new InputReader(System.in);
		PrintWriter out = new PrintWriter(System.out);
		long n=in.nextLong();
		int k=in.nextInt();
		//out.println(s);
		String s=Long.toString(n);
		int ans=s.length()-1count=0,rem=0,flag=0;

		if(s.length()<=k){}
		else
		{
		for(int i=s.length()-1;i>=0;i--)
		{
			if(s.charAt(i)=='0')
			{
				count++;
			}
			else
			{
				rem++;
			}
			if(count==k)
				{
				flag=1;
				break;

				}
		}
		}

		if(flag==1)
		out.println(rem);
		else
			out.println(ans);
		out.close();
	}

	static class Pairs implements Comparable<Pairs> {
		int x;
		int y;

		Pairs(int a, int b) {
			x = a;
			y = b;
		}

		@Override
		public int compareTo(Pairs o) {
			// TODO Auto-generated method stub
			if (x == o.x)
				return Integer.compare(y, o.y);
			else
				return Integer.compare(x, o.x);
		}

	}

	public static void debug(Object... o) {
		System.out.println(Arrays.deepToString(o));
	}

	public static boolean isPal(String s) {
		for (int i = 0, j = s.length() - 1; i <= j; i++, j--) {
			if (s.charAt(i) != s.charAt(j))
				return false;
		}
		return true;
	}

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

	public static long gcd(long x, long y) {
		if (y == 0)
			return x;
		if (x % y == 0)
			return y;
		else
			return gcd(y, x % y);
	}

	public static int gcd(int x, int y) {
		if (x % y == 0)
			return y;
		else
			return gcd(y, x % y);
	}

	public static long gcdExtended(long a, long b, long[] x) {

		if (a == 0) {
			x[0] = 0;
			x[1] = 1;
			return b;
		}
		long[] y = new long[2];
		long gcd = gcdExtended(b % a, a, y);

		x[0] = y[1] - (b / a) * y[0];
		x[1] = y[0];

		return gcd;
	}

	public static int abs(int a, int b) {
		return (int) Math.abs(a - b);
	}

	public static long abs(long a, long b) {
		return (long) Math.abs(a - b);
	}

	public static int max(int a, int b) {
		if (a > b)
			return a;
		else
			return b;
	}

	public static int min(int a, int b) {
		if (a > b)
			return b;
		else
			return a;
	}

	public static long max(long a, long b) {
		if (a > b)
			return a;
		else
			return b;
	}

	public static long min(long a, long b) {
		if (a > b)
			return b;
		else
			return a;
	}

	public static long[][] mul(long a[][], long b[][]) {
		long c[][] = new long[2][2];
		c[0][0] = a[0][0] * b[0][0] + a[0][1] * b[1][0];
		c[0][1] = a[0][0] * b[0][1] + a[0][1] * b[1][1];
		c[1][0] = a[1][0] * b[0][0] + a[1][1] * b[1][0];
		c[1][1] = a[1][0] * b[0][1] + a[1][1] * b[1][1];

		return c;
	}

	public static long[][] pow(long n[][], long p, long m) {
		long result[][] = new long[2][2];
		result[0][0] = 1;
		result[0][1] = 0;
		result[1][0] = 0;
		result[1][1] = 1;

		if (p == 0)
			return result;
		if (p == 1)
			return n;
		while (p != 0) {
			if (p % 2 == 1)
				result = mul(result, n);
			//System.out.println(result[0][0]);
			for (int i = 0; i < 2; i++) {
				for (int j = 0; j < 2; j++) {
					if (result[i][j] >= m)
						result[i][j] %= m;
				}
			}

			p >>= 1;
			n = mul(n, n);
			// System.out.println(1+" "+n[0][0]+" "+n[0][1]+" "+n[1][0]+" "+n[1][1]);
			for (int i = 0; i < 2; i++) {
				for (int j = 0; j < 2; j++) {
					if (n[i][j] >= m)
						n[i][j] %= m;
				}
			}
		}
		return result;
	}

	public static long pow(long n, long p) {
		long result = 1;
		if (p == 0)
			return 1;
		if (p == 1)
			return n;
		while (p != 0) {
			if (p % 2 == 1)
				result *= n;
			p >>= 1;
			n *= n;
		}
		return result;
	}

	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) {
			int a[] = new int[n];
			for (int i = 0; i < n; i++) {
				a[i] = nextInt();
			}
			return a;
		}

		public long[] nextLongArray(int n) {
			long a[] = new long[n];
			for (int i = 0; i < n; i++) {
				a[i] = nextInt();
			}
			return a;
		}

		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.text.DecimalFormat;
import java.util.Scanner;

public class A_New_Year_Table {

	/**
	 *
	 * 2012-1-6
	 *
	 * @author froest
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scan = new Scanner(System.in);
		int a[] = new int[3];
		for (int i = 0; i < 3; i++) {
			a[i] = scan.nextInt();
		}
		if(a[0] == 1){
			if(a[1]>=a[2]){
				System.out.println("YES");
			}else{
				System.out.println("NO");
			}
		}else if(a[0] == 2){
			if(a[1]>=2*a[2]){
				System.out.println("YES");
			}else{
				System.out.println("NO");


import java.util.Scanner;
public class EatingSoup {
    public static void main(String[] args) {
        Scanner scnr = new Scanner(System.in);
        int a = scnr.nextInt();
        int b = scnr.nextInt();

        if (a%b == 0) {
            System.out.println(b);
        }
      else   System.out.println(a%b);

    }
}


import java.util.Arrays;
import java.util.PriorityQueue;
import java.util.Scanner;
import java.util.Vector;

public class b {

	//static int[]visit;
	static int[]m;
	//static int[][]temp;
	public static void main(String args[]) {

            Scanner sc=new Scanner(System.in);

            int n=sc.nextInt();
            int t=sc.nextInt();

            char[] s1=sc.next().toCharArray();
            char[] s2=sc.next().toCharArray();
            int[]a1=new int[26];
            int[]a2=new int[26];
            for (int i = 0; i < n; i++) {
             a1[s1[i]-'a']++;
            }
            for (int i = 0; i < n; i++) {
             a2[s2[i]-'a']++;
            }
           int h=t;
           int j=0;
           String res="";
           while(h>0)
           {

               if(a1[j]==0&&a2[j]==0)
               {
                   int min=Math.max(a1[j], a2[j]);
                    min=Math.max(h, min);

                   for (int i = 0; i < min; i++) {
                       res+=(char)(j+'a');
                   }
                   h-=min;

               }
               j++;

           }
            for (int i = 0; i < 26; i++) {
                if(a1[i]>0&&a2[i]>0)
                {

                    for (int k = 0; k < n-t; k++) {
                         res+=(char)(i+'a');
                    }
                    break;

                }
            }

}

}


import java.util.*;
import java.lang.*;
import java.io.*;
import java.util.Scanner;
public class sample
{
    public static void main(String[] args)
    {
        Scanner in = new Scanner(System.in);
        int a=in.nextInt();
        int b=in.nextInt();
        int c=in.nextInt();
        int d=in.nextInt();
        int v,m,x,y,w,z;
        x=3*a/10;
        y=a-a/250*c;
        if(x>y)
            m=x;
        else
            m=y;
        w=3*b/10;
        z=b-b/250*d;
        if(w>z)
            v=w;
        else
            v=z;a
        //System.out.println(m);
        //System.out.println(v);
        if(v>m)
            System.out.println("Vasya");
        else if(v<m)
            System.out.println("Misha");
        else if(v==m)
            System.out.println("Tie");

    }

}


import java.util.Scanner;
public class Problem460A {
	public static void main(String[] args) {
		Scanner console=new Scanner(System.in);
		int n=console.nextInt();
		int m=console.nextInt();
		int k=m;
		boolean test=true;
		int sum=n;
		while(test) {
			sum=sum+(n/m);
			if(n/m==1) {
				test=false;
			}
			n=n/m;
		}
		if(sum%k==0) {
			System.out.println(sum+1);
		} else {
			System.out.println(sum);
		}
	}
}


import java.util.Scanner;

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

        int numSocks = scan.nextInt();
        int numDays = scan.nextInt();

        int consecutiveDays = 0;

        while(numSocks > 0){
            consecutiveDays += numSocks;
            numSocks = (numSocks/numDays) + (numSocks%numDays);
        }

        System.out.println(consecutiveDays);
    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

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

    static class TaskC {
        int n;
        int a;
        int dp;

        int dfs(int i, int player) {

            if (i == n)
                return 0;

            if (dp[i][player] != -1)
                return dp[i][player];

//        int nxt = (player == 1 ? 2 : 1);

            int x = a[i] + dfs(i + 1, 2);
            int y = dfs(i + 1, 1);

            if (player == 1)
                dp[i][player] = Integer.max(x, y);
            else
                dp[i][player] = Math.min(x, y);

            return dp[i][player];
        }

        public void solve(int testNumber, InputReader in, PrintWriter out) {

            n = in.nextInt();
            a = new int[n];

            int sum = 0;
            for (int i = 0; i < n; ++i) {
                a[i] = in.nextInt();
                sum += a[i];
            }

            dp = new int[n][3];
            for (int i = 0; i < n; ++i)
                Arrays.fill(dp[i], -1);

            int bob = dfs(0, 1);
            int alice = sum - bob;

            out.println(alice + " " + bob);
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;
        public String test_string;

        public InputReader(InputStream test_stringeam) {
            reader = new BufferedReader(new InputStreamReader(test_stringeam), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    String line = null;
                    if (test_string != null) {
                        line = test_string;
                        test_string = null;
                    } else
                        line = reader.readLine();

                    tokenizer = new StringTokenizer(line);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}


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

public class Main{
   public static void main(String[] args) {
      MyScanner sc = new MyScanner();
      out = new PrintWriter(new BufferedOutputStream(System.out));

      // Start writing your solution here. -------------------------------------

      int n      = sc.nextInt();        // read input as integer
      String str = sc.nextLine();       // read whole line as String
      int result = 0;
      String index1, index2;

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

         index1 = Character.toString(str.charAt(i));
         index2 = Character.toString(str.charAt(i+1));
         if (index1.equals(index2))
           result = result + 1;
      }

      out.println(result);

      // Stop writing your solution here. -------------------------------------
      out.close();
   }

   //-----------PrintWriter for faster output---------------------------------
   public static PrintWriter out;

   //-----------MyScanner class for faster input----------
   public static class MyScanner {
      BufferedReader br;
      StringTokenizer st;

      public MyScanner() {
         br = new BufferedReader(new InputStreamReader(System.in));
      }

      String next() {
          while (st == null || !st.hasMoreElements()) {
              try {
                  st = new StringTokenizer(br.readLine());
              } catch (IOException e) {
                  e.printStackTrace();
              }
          }
          return st.nextToken();
      }

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

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

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

      String nextLine(){
          String str = "";
	  try {
	     str = br.readLine();
	  } catch (IOException e) {
	     e.printStackTrace();
	  }
	  return str;
      }

   }
   //--------------------------------------------------------
}


package z;

import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc .nextInt();
        ArrayList<Exam> exams = new ArrayList<Exam>();
        Map<Integer,Exam> dayExam = new HashMap<>();
        int ddd;
        for(int i=0;i<m;i++){
            exams.add(new Exam(sc.nextInt(), ddd = sc.nextInt(),sc.nextInt()));
            dayExam.put(ddd,exams.get(i));
        }
        Collections.sort(exams);
        int kk = 0;
        String output="";
        for(int i =1 ; i<=n;i++){
            int k = 0;
            if(dayExam.keySet().contains(i)){
                if(dayExam.get(i).prepDays!=0) {
                    System.out.println("-1");
                    System.exit(0);
                }
                output+= (m+1) + " ";
                kk++;
                continue;
            }
            int o=0;
            while(k < m && (o = exams.get(k).prepare(i)) == 0){
                k++;
            }
            output+=o+" ";
            k++;

        }
        output.substring(0,output.length());
        System.out.println(output);

    }
}
class Exam implements Comparable<Exam>{
    int examDay;
    int prepDays;
    int questionsDays;
    int examID;
    static int examsCounter=1;

    public Exam(int questionsDays,int examDay, int prepDays) {
        this.examID=examsCounter;
        examsCounter++;
        this.questionsDays=questionsDays;
        this.examDay = examDay;
        this.prepDays = prepDays;
    }
    int prepare(int i){
        if (prepDays!=0&&questionsDays<=i) {
            prepDays--;
            return examID;
            }
            return 0;
    }

    @Override
    public int compareTo(Exam other) {
        if(this.questionsDays<other.questionsDays)
            return -1;
        else if (this.questionsDays==other.questionsDays)
            return Integer.compare(this.examDay,other.examDay);
        else
            return 1;
    }
}


import java.util.*;
public class test{

    public static void main(String[]args){
        Scanner scn = new Scanner(System.in);
        long n=scn.nextInt();
        int count=0;
        while(n!=0){
            if(n%10==4||n%10==7)count++;
            n/=10;
        }

        if(count==4||count==7){
            System.out.println("YES");
        }else{
            System.out.println("NO");
        }

    }
}


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

public class Round170D {
	public static void main(String[] args) throws IOException {
		getLine();
		n = nextInt();
		a = new int[n];
		getLine();
		for(int i=0; i<n; i++) a[i] = nextInt();
		int bin = binary(1, n);
		System.out.println(bin);
	}

	static int binary(int x, int y){
	//	System.out.println("binary on "+x+","+y);
		if(x==y) return isOk(x)? x: -1;
		if(y==x+1) return isOk(x)? x: isOk(y)? y: -1;
		int m = (x+y)>>1;
		return isOk(m)? binary(x, m): binary(m+1, y);
	}

	static boolean isOk(int sz){
		size = sz;
		curIter++;
		fal++;
		boolean b = canGet(1, 1);
		//System.out.println(sz+" "+b);
		return b;
	}

	static char curIter = 'a', fal = Character.toUpperCase(curIter);

	static int size = 0;

	static boolean canGet(int mask, int cur){
	//	System.out.println(mask+" "+cur);
	//	if(cur==n) System.out.println("OH YEAH");
		if(cur==n) return true;
		if(dp[mask][cur]==curIter || dp[mask][cur]==fal) return dp[mask][cur]==curIter;
		if(!can(mask, a[cur])){
			dp[mask][cur] = fal;
			return false;
		}
		int M = mask;
		if(Integer.bitCount(mask)+1<=size){
			if(canGet((M^(1<<cur)), cur+1)){
				dp[mask][cur] = curIter;
				return true;
			}
		}
		for(int i=0; i<cur; i++){
			M = mask;
			if((M&(1<<i))!=0) M ^= (1<<i);
			M ^= (1<<cur);
			if(canGet(M, cur+1)){
				dp[mask][cur] = curIter;
				return true;
			}
		}
		dp[mask][cur] = fal;
		return false;
	}

	static boolean can(int mask, int sum){
		HashSet<Integer> set = new HashSet<Integer>();
		for(int s=0; s<n; s++) if((mask&(1<<s))!=0){
			set.add(a[s]);
		}
		for(int s=0; s<n; s++){
			if((mask&(1<<s))!=0){
				if(set.contains(sum-a[s])) return true;
			}
		}
		return false;
	}

	static final int SIZE = 23;

	static char[][] dp = new char[(1<<SIZE)][SIZE];

//	static boolean[][] can = new boolean[(1<<SIZE)][SIZE];

	static int[] a;
	static int n;

	static void getLine() throws IOException {
		st = new StringTokenizer(rd.readLine());
	}

	static int nextInt(){
		return Integer.parseInt(st.nextToken());
	}

	static BufferedReader rd = new BufferedReader(new InputStreamReader(System.in));
	static PrintWriter pw = new PrintWriter(System.out);
	static StringTokenizer st;

}


import java.util.Arrays;
import java.util.Scanner;

/**
 * 0da - 24.02.2018.
 */
public class B {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int k = scanner.nextInt();
        int A = scanner.nextInt();
        int B = scanner.nextInt();

        int[] array = new int[n + 1];

        Arrays.fill(array, Integer.MAX_VALUE);

        array[1] = 0;

        for (int i = 1; i < array.length; i++) {
            int price = array[i];
            int multiplication = i * k;
            if (multiplication <= n) {
                array[multiplication] = Math.min(price + B, array[multiplication]);
            }

            int inc = i+1;
            if (inc <= n) {
                array[inc] = Math.min(price + A, array[inc]);
            }
        }

        System.out.println(array[n]);
    }
}


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

public class Main {
    static PrintWriter out = new PrintWriter(new BufferedWriter(
            new OutputStreamWriter(System.out)));

    public static void main(String[] args) throws IOException {
        // PrintStream out = new PrintStream(new
        // FileOutputStream("out.out"));
        Scan scan = new Scan();
        int n = scan.nextInt();
        out.println(solve(n));
        out.flush();
    }
    static String solve(int c){
        if(c==1)
            return "one";
        if(c==2)
            return "two";
        if(c==3)
            return "three";
        if(c==4)
            return  "four";
        if(c==5)
            return "five";
        if(c==6)
            return "six";
        if(c==7)
            return "seven";
        if(c==8)
            return "eight";
        if(c==9)
            return "nine";
        if(c==10)
            return "ten";
        if(c==11)
            return "eleven";
        if(c==12)
            return "twelve";
        if(c==13)
            return "thirteen";
        if(c==14)
            return "fourteen";
        if(c==15)
            return "fifteen";
        if(c==16)
            return "sixteen";
        if(c==17)
            return "seventeen";
        if(c==18)
            return "eighteen";
        if(c==19)
            return  "nineteen";
        if(c==20)
            return "twenty";
        if(c==21)
            return "twenty-one";
        if(c==22)
            return "twenty-two";
        if(c==23)
            return  "twenty-three";
        if(c==24)
            return  "twenty-four";
        if(c==25)
            return "twenty-five";
        if(c==26)
            return  "twenty-six";
        if(c==27)
            return "twenty-seven";
        if(c==28)
            return "twenty-eight";
        if(c==29)
            return "twenty-nine";
        if(c==30)
            return  "thirty";
        if(c==31)
            return "thirty-one";
        if(c==32)
            return "thirty-two";
        if(c==33)
            return  "thirty-three";
        if(c==34)
            return  "thirty-four";
        if(c==35)
            return "thirty-five";
        if(c==36)
            return  "thirty-six";
        if(c==37)
            return "thirty-seven";
        if(c==38)
            return "thirty-eight";
        if(c==39)
            return "thirty-nine";
        if(c==40)
            return  "forty";
        if(c==41)
            return "forty-one";
        if(c==42)
            return "forty-two";
        if(c==43)
            return  "forty-three";
        if(c==44)
            return  "forty-four";
        if(c==45)
            return "forty-five";
        if(c==46)
            return  "forty-six";
        if(c==47)
            return "forty-seven";
        if(c==48)
            return "forty-eight";
        if(c==49)
            return "forty-nine";
        if(c==50)
            return "fifty";
        if(c==51)
            return "fifty-one";
        if(c==52)
            return "fifty-two";
        if(c==53)
            return  "fifty-three";
        if(c==54)
            return  "fifty-four";
        if(c==55)
            return "fifty-five";
        if(c==56)
            return  "fifty-six";
        if(c==57)
            return "fifty-seven";
        if(c==58)
            return "fifty-eight";
        if(c==59)
            return "fifty-nine";
        if(c==60)
            return "sixty";
        if(c==61)
            return "sixty-one";
        if(c==62)
            return "sixty-two";
        if(c==63)
            return  "sixty-three";
        if(c==64)
            return  "sixty-four";
        if(c==65)
            return "sixty-five";
        if(c==66)
            return  "sixty-six";
        if(c==67)
            return "sixty-seven";
        if(c==68)
            return "sixty-eight";
        if(c==69)
            return "sixty-nine";
        if(c==70)
            return "seventy";
        if(c==71)
            return "seventy-one";
        if(c==72)
            return "seventy-two";
        if(c==73)
            return  "seventy-three";
        if(c==74)
            return  "seventy-four";
        if(c==75)
            return "seventy-five";
        if(c==76)
            return  "seventy-six";
        if(c==77)
            return "seventy-seven";
        if(c==78)
            return "seventy-eight";
        if(c==79)
            return "seventy-nine";
        if(c==80)
            return "eighty";
        if(c==81)
            return "eighty-one";
        if(c==82)
            return "eighty-two";
        if(c==83)
            return  "eighty-three";
        if(c==84)
            return  "eighty-four";
        if(c==85)
            return "eighty-five";
        if(c==86)
            return  "eighty-six";
        if(c==87)
            return "eighty-seven";
        if(c==88)
            return "eighty-eight";
        if(c==89)
            return "eighty-nine";
        if(c==90)
            return "ninety";
        if(c==91)
            return "ninety-one";
        if(c==92)
            return "ninety-two";
        if(c==93)
            return  "ninety-three";
        if(c==94)
            return  "ninety-four";
        if(c==95)
            return "ninety-five";
        if(c==96)
            return  "ninety-six";
        if(c==97)
            return "ninety-seven";
        if(c==98)
            return "ninety-eight";
        if(c==99)
            return "ninety-nine";
        return "zero";
;
    }
}

class Scan {

    BufferedReader buffer;
    StringTokenizer tok;

    Scan() {
        buffer = new BufferedReader(new InputStreamReader(System.in));
        // FileReader filereader=null;
        // try {
        // filereader = new FileReader("in.in");
        // } catch (FileNotFoundException e) {
        // // TODO Auto-generated catch block
        // e.printStackTrace();
        // }
        // buffer = new BufferedReader(filereader);
    }

    boolean hasNext() {
        while (tok == null || !tok.hasMoreElements()) {
            try {
                tok = new StringTokenizer(buffer.readLine());
            } catch (Exception e) {
                return false;
            }
        }
        return true;
    }

    String next() {
        if (hasNext())
            return tok.nextToken();
        return null;
    }

    String nextLine() {
        String s = null;
        try {
            s = buffer.readLine();
        } catch (Exception e) {
            return null;
        }
        return s;
    }

    char nextChar() {
        try {
            return ((char) buffer.read());
        } catch (Exception e) {
        }
        return '\0';
    }

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

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

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


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

public final class ProblemC {
    private static boolean hasVertexWithZeroInDegree(final int[] out) {
        final int[] in = new int[out.length];
        for (int to: out) {
            in[to]++;
        }
        for (int indegree: in) {
            if (indegree == 0) {
                return true;
            }
        }
        return false;
    }

    private static int cycleLength(
            final int[] out,
            final int i,
            final boolean[] visited) {
        int length = 1;
        for (int to = out[i]; to != i;) {
            length++;
            visited[to] = true;
            to = out[to];
        }
        return length;
    }

    private static int gcd(final int a, final int b) {
        if (a < b) {
            return gcd(b, a);
        } else if (b == 0) {
            return a;
        } else {
            return gcd(b, a % b);
        }
    }

    private static int lcm(final int a, final int b) {
        return a / gcd(a, b) * b;
    }

    public static void main(final String[] args) {
        final Scanner in = new Scanner(System.in);
        final int n = in.nextInt();
        final int[] crush = new int[n];
        for (int i = 0; i < n; i++) {
            crush[i] = in.nextInt();
        }
        if (hasVertexWithZeroInDegree(crush)) {
            System.out.println(-1);
        }

        List<Integer> cycles = new ArrayList<>();
        final boolean[] visited = new boolean[n];
        for (int i = 0; i < n; i++) {
            if (visited[i]) {
                continue;
            }
            final int cycleLength = cycleLength(crush, i, visited);
            cycles.add(cycleLength);
        }

        if (cycles.size() == 1) {
            System.out.println(cycles.get(0));
        } else {
            int lcm = lcm(cycles.get(0), cycles.get(1));
            for (int i = 2; i < cycles.size(); i++) {
                lcm = lcm(lcm, cycles.get(i));
            }
            System.out.println(lcm);
        }
    }
}


public class Code {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws Exception {
          Scanner s=new Scanner(System.in);
       int n=s.nextInt();
       int m=s.nextInt();

       while(true){
           int f=0,f1=0;
           if(n*100+m*10<220 ||m<2){
               System.out.println("Hanako");
               System.exit(0);}
           else if (n>=2)
            {
             n-=2;m-=2; }
         else if(n>0){
           n-=1;m-=12;
           }
           else
         {m-=22;}
           if(n*100+m*10<220 ||m<2){
               System.out.println("Ceil");
               System.exit(0);}
           else if(m>=22)
           {m-=22;}
           else if(m>=12 && m<22)
           {m-=12;n-=1;}
           else {
           n-=2;m-=2;}

       }

    }
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Scanner;
import java.util.StringTokenizer;

/**
 * Created by triplea on 7/27/14.
 */
public class ProblemA {
    public static String[] words = new String[]{"vaporeon", "jolteon", "flareon", "espeon", "umbreon", "leafeon", "glaceon", "sylveon"};
    public static MyScanner scanner = new MyScanner();
    public static void main(String[] args) {
        int n= scanner.nextInt(),counter=0;
        System.out.println(n);
        String tmp= scanner.next();
        System.out.println(tmp);
        ArrayList<String> list = new ArrayList<String>();
        for(String str : words){
            if(str.length()==n){
                System.out.println(3);
                list.add(str);
            }
        }
        while (counter<n && list.size()!=1){
            System.out.println("counter : " + counter);
            if(tmp.charAt(counter)!='.') {
                ArrayList<String> tmpList = new ArrayList<String>();
                for (String str : list) {
                    if (str.charAt(counter) == tmp.charAt(counter)) {
                        tmpList.add(str);
                    }
                }
                list.clear();
                list.addAll(tmpList);
            }
            counter++;
        }
        if(!list.isEmpty()) System.out.println(list.get(0));
    }
    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        public MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

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

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

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

        String nextLine(){
            String str = "";
            try {
                str = br.readLine();
            } catch (Exception e) {
                e.printStackTrace();
            }
            return str;
        }
}


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

public class hsp-903A {
	public static void main (String[] args) throws Exception {
	    BufferedReader bfr = new BufferedReader(new InputStreamReader(System.in));

	    int n = Integer.parseInt(bfr.readLine());

	    while(n > 0) {
	        boolean hsp = false;
	        int num = Integer.parseInt(bfr.readLine());

            for (int i=0; i<=33;i++) {
                for (int j=0; j<=33; j++) {
                    if (3*i + 7*j == num) {
                        hsp = true;
                        break;
                    }
                    else if (3*i + 7*j > num) break;
                }
                if(hsp) break;
            }
	        if(hsp) {
	            System.out.println("YES");
	        }else {
	            System.out.println("NO");
	        }
	        n--;
	    }
	}
}


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

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author janux
 */
public class SuperAgent {

    static String yes = "YES";
    static String no = "NO";

    static char[][] rotate90(char[][] mat) {
        char[][] ret =new char[3][3];
        for (int col = 0, i = 0; col < 3; ++ col, ++ i) {
            for (int row = 2, j = 0; row >= 0; -- row, ++ j) {
                ret[i][j] = mat[row][col];
//                System.out.print(mat[row][col] + " ");
            }
//            System.out.println("");
        }
        return ret;
    }

    public static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        char[][] g = new char[3][];
        g[0] = in.readLine().toCharArray();
        g[1] = in.readLine().toCharArray();
        g[2] = in.readLine().toCharArray();

        char[][] gr = rotate90(rotate90(g));

        boolean valid = true;
        for (int  i =0; i <3; ++ i)
            if (!Arrays.equals(g[0], gr[0])) {
                valid = false;
                break;
            }

//        if (g[1][0] != g[1][2]) {
//            valid = false;
//        }
//        char[][] test = {{'1','2','3'},{'4','5','6'},{'7','8','9'}};
//        char[][] r = rotate90(test);
//        for (int  i = 0; i < 3; ++ i)
//            System.out.println(new String(r[i]));
        System.out.println(valid ? yes : no);
    }
}


import java.io.IOException;
import java.io.InputStream;
import java.io.PrintStream;
import java.util.Scanner;

/**
 * Created by fengp on 10/10/17.
 */
public class CF869B {
    public static int solve(long a, long b){
        if (b-a>=5)return 0;
        int ans=1;
        for (long c=a+1;c<=b;++c){
            ans*=(c%10);
        }
        return ans%10 ;
    }

    public static void main(String[] args) {

        InputStream input = System.in;
        PrintStream output = System.out;
        if (args.length == 2) {
            try {
                input = CF867A.class.getClassLoader().getResourceAsStream(args[0]);
                output = new PrintStream(args[1]);
            } catch (IOException e) {
                e.printStackTrace();
                return;
            }
        }
        Scanner in = new Scanner(input);
        while (in.hasNextLong()) {
            long a;
            a = in.nextLong();
            long b;
            b = in.nextLong();
            output.println(String.format("%d", solve(a,b)));
        }
    }
}


import java.util.*;
public class a{
	public static void main(String args[]){
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int a=sc.nextInt();
		int x=sc.nexInt();
		int b=sc.nextInt();
		int y=sc.nextInt();
		int t=0;
		int ans=0;
		while(t>n){
			if(a==b)
				ans++;
			a++;
			b--;
			t++;
			if(a==x)
				break;
			if(b==y)
				break;
			if(a>n)
				a=1;
			if(b==0)
				b=n;
		}
		System.out.println(ans==0?"NO":"YES");

	}
}


import java.io.IOException;
import java.io.InputStream;
import java.math.BigInteger;
import java.util.InputMismatchException;

public class E {
    final static int MOD = 1000000007;
    static long max = 1;
    static long cap = 1;
    static long[] powOf2 = new long[64];

    public static void main(String[] args) throws Exception {
        FastReader in = new FastReader(System.in);
        max = in.nextLong();
        cap = in.nextLong();

        long odd = binarySearchOdd(1,  (max + 1L) / 2L * 2L - 1L);
        long even = binarySearchEven(2, max / 2L * 2L);
        long res = Math.max(odd, even);
        System.out.println(res);
    }

    private static long binarySearchEven(long min, long max) {
        if (max == min + 2L) {
            if (countEven(min) >= cap) {
                return min;
            } else {
                return -1;
            }
        }
        long avg = (max + min) / 2L;
        if (avg % 2 == 1) avg--;
        long countAvg = countEven(avg);
        if (countAvg < cap) {
            return binarySearchEven(min, avg);
        } else {
            return binarySearchEven(avg, max);
        }
    }

    private static long binarySearchOdd(long min, long max) {
        if (max == min + 2L) {
            if (countOdd(min) >= cap) {
                return min;
            } else {
                return -1;
            }
        }
        long avg = (max + min) / 2L;
        if (avg % 2 == 0) avg--;
        long countAvg = countOdd(avg);
        if (countAvg < cap) {
            return binarySearchOdd(min, avg);
        } else {
            return binarySearchOdd(avg, max);
        }
    }

    private static long countEven(long n) {
        long k = n / 2L;
        double mDouble = log2((double)max / (double)k);
        long m = (long) mDouble;
        long count = 0;
        for (int i = 1; i <= m; i++) {
            count += powOf2(i);
        }
        long endLevelM = powOf2(m) * k + powOf2(m) - 1;
        long lackLevelM = 0;
        if (max < endLevelM) {
            lackLevelM = Math.min(endLevelM - max, powOf2(m));
        }
        return count - lackLevelM;
    }

    private static long countOdd(long n) {
        if (n == 1) return max;
        long k = (n - 1L) / 2L;
        double mDouble = 1 + log2((double)max / ((double)k + 1D));
        long m = (long) mDouble;
        long count = 0;
        for (int i = 1; i <= m; i++) {
            count += powOf2(i - 1L);
        }
        long endLevelM = powOf2(m) * k + powOf2(m) - 1;
        long lackLevelM = 0;
        if (max < endLevelM) {
            lackLevelM = Math.min(endLevelM - max, powOf2(m - 1));
        }
        return count - lackLevelM;
    }

    private static long powOf2(long n) {
        if (powOf2[(int)n] == 0) {
            long res = 1;
            for (int i = 0; i < n; i++) {
                res *= 2L;
            }
            powOf2[(int)n] = res;
        }
        return powOf2[(int)n];
    }

    private static double log2(double x) {
        double log2 = Math.log(2);
        double logx = Math.log(x);
        return logx / log2;
    }

    static class FastReader {
        private boolean finished = false;

        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;

        public FastReader(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 peek() {
            if (numChars == -1) {
                return -1;
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    return -1;
                }
                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 == ',') {
                    c = read();
                }
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long 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 {
                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;
        }

        private String readLine0() {
            StringBuilder buf = new StringBuilder();
            int c = read();
            while (c != '\n' && c != -1) {
                if (c != '\r') {
                    buf.appendCodePoint(c);
                }
                c = read();
            }
            return buf.toString();
        }

        public String nextLine() {
            String s = readLine0();
            while (s.trim().length() == 0)
                s = readLine0();
            return s;
        }

        public String nextLine(boolean ignoreEmptyLines) {
            if (ignoreEmptyLines) {
                return nextLine();
            } else {
                return readLine0();
            }
        }

        public BigInteger nextBigInteger() {
            try {
                return new BigInteger(nextString());
            } catch (NumberFormatException e) {
                throw new InputMismatchException();
            }
        }

        public char nextCharacter() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            return (char) c;
        }

        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 boolean isExhausted() {
            int value;
            while (isSpaceChar(value = peek()) && value != -1)
                read();
            return value == -1;
        }

        public String next() {
            return nextString();
        }

        public SpaceCharFilter getFilter() {
            return filter;
        }

        public void setFilter(SpaceCharFilter filter) {
            this.filter = filter;
        }

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


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

// author @mdazmat9
public class codeforces{
  static   HashSet set=new HashSet();
  static  int a,b,c;
    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int test = 1;
        for (int ind = 0; ind < test; ind++) {
             a=sc.nextInt();
             b=sc.nextInt();
              c=sc.nextInt();
            recursion(a,b,c);
            if(set.contains(true)){
                out.println("Yes");
            }
            else
                out.println("No");

        }
        out.flush();
    }
    static void recursion(int x,int y,int z){
     //   System.out.println(x+" "+y+" "+z);
        if(x==c || y==c || x+y==c){
            set.add(true);
            return;
        }
        if(x+y>c)
            return;
            recursion(x+a,y,z);
            recursion(x,y+b,z);

    }

    static long gcd(long a , long b)
    {
        if(b == 0)
            return a;
        return gcd(b , a % b);
    }

}
class Scanner {
    public BufferedReader reader;
    public StringTokenizer st;

    public Scanner(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        st = null;
    }

    public String next() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = reader.readLine();
                if (line == null) return null;
                st = new StringTokenizer(line);
            } catch (Exception e) {
                throw (new RuntimeException());
            }
        }
        return st.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    public long nextLong() {
        return Long.parseLong(next());
    }

    public double nextDouble() {
        return Double.parseDouble(next());
    }
}

class OutputWriter {
    BufferedWriter writer;

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

    public void print(int i) throws IOException {
        writer.write(i);
    }

    public void print(String s) throws IOException {
        writer.write(s);
    }

    public void print(char[] c) throws IOException {
        writer.write(c);
    }

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

}