import java.text.DecimalFormat;
import java.io.*;
import java.util.*;
import java.lang.reflect.Array;

/**
 * @author Mukesh Singh
 *
 */

public class AB {

    private InputStream input;
    private PrintStream output;
    private Scanner inputSc;

    public AB(InputStream input, PrintStream output) {
        this.input = input;
        this.output = output;
        init();
    }

    private void init() {
        inputSc = new Scanner(input);
    }

    static int lineToInt(String line) {
        return Integer.parseInt(line);
    }

    static long lineToLong(String line) {
        return Long.parseLong(line);
    }
    static double lineToDouble(String line) {
        return Double.parseDouble(line);
    }

    public void solve()
	{
            solveTestCase();
    }

/**
 * @define global / instance variables
 */

	HashMap<Integer,Integer> mat[] ;
	long dist[] ;
	long vec[] ;
	int par[] ;
	boolean isDone[] ;
	final long INF = 100000000000000000L ;
	int N;
/**
 * @solve test case
 */
@SuppressWarnings("unchecked")
    private void solveTestCase()
	{
		int i , j  , k , n , m ,a ;
		long N , M, K,I, J;
		DecimalFormat df = new DecimalFormat("#,###,##0.00");
        String str = inputSc.nextLine();
        String delims = "[ ]+";
		String[] tokens = str.split(delims);
		n = lineToInt(tokens[0]);
		m = lineToInt(tokens[1]);
		if ( n < m )
			a = n ;
		else
			a = m ;
		if(a%2 == 0 )
			output.println("Malvika");
		else
			output.println("Akshat");

    }

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args)
	{
		FileInputStream in = null;
      	FileOutputStream out = null;
		PrintStream ps = null ;
		InputStream is = null ;
		try
		{
         	is = new FileInputStream("file.in");
         	out = new FileOutputStream("file.out");
			ps = new PrintStream(out);
        }
		catch ( Exception e )
		{}

        AB sd = new AB(System.in, System.out);
        sd.solve();
		try
		{
        if (is != null)
		{
	      is.close();
	    }
       	if (out != null) {
           	out.close();
       	}
		if (ps != null) {
           	ps.close();
         }
      	}catch (Exception e){}

		//SquareDetector sd = new SquareDetector(System.in, System.out);
        //sd.solve();
    }
}


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

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

class TaskA {
    public void solve(int testNumber, Scanner in, PrintWriter out) {
        int N = in.nextInt();
        int[] changes = {2, 7, 2, 3, 3, 4, 2, 5, 1, 2  };
        out.print(changes[N / 10] * changes[N % 10]);

    }
}


//no full solution
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.StringTokenizer;

//codeforce
public class codeforce {

    private static BufferedReader in;
    private static PrintWriter out;
    private static StringTokenizer input;

    public static void main(String[] args) throws IOException {
        // -------------------------------------------------------------------------
        // Initializing...
        new codeforce();
        // -------------------------------------------------------------------------
        // put your code here... :)

        String s1=nextString();
        String result="YES";
        int counter=0;
        for (int i = 0; i < s1.length(); i++) {
            if(s1.charAt(i)=='4'||s1.charAt(i)=='7'){
                counter++;
            }
        }
        if(counter==4||counter==7){
            System.out.println("YES");
        }else{
            System.out.println("NO");
        }

        // writeln("");
        // -------------------------------------------------------------------------
        // closing up
        end();
        // --------------------------------------------------------------------------

    }
    private static String nextString() throws IOException {
        if (!input.hasMoreTokens())input=new StringTokenizer(in.readLine());
        return input.nextToken();
    }
    public codeforce() throws IOException {
        // Input Output for Console to be used for trying the test samples of
        // the problem
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        // -------------------------------------------------------------------------
        // Initalize Stringtokenizer input
         input = new StringTokenizer(in.readLine());
    }

    private static int nextInt() throws IOException {
        if (!input.hasMoreTokens())
            input = new StringTokenizer(in.readLine());
        return Integer.parseInt(input.nextToken());
    }

    private static void end() throws IOException {
        in.close();
        out.close();
        System.exit(0);
    }

}


/*
Keep solving problems.
*/

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

public class CFA {
    BufferedReader br;
    PrintWriter out;
    StringTokenizer st;
    boolean eof;
    private static final long MOD = 998244353L;
    private static final int[] dx1 = {0, 1};
    private static final int[] dy1 = {1, 0};
    private static final int[] dx2 = {-1, 0};
    private static final int[] dy2 = {0, -1};
    private static final String yes = "Yes";
    private static final String no = "No";

    int LIMIT = 1000 * 100 * 5 + 100;
//    int LIMIT = 100;
    long[] inv;
    long[] fact;
    void solve() throws IOException {
        int n = nextInt();
        int k = nextInt();
        inv = new long[LIMIT];
        fact = new long[LIMIT];
        fact[0] = 1;
        for (int i = 1; i < LIMIT; i++) {
            fact[i] = fact[i - 1] * i % MOD;
        }
        inv[LIMIT - 1] = powMod(fact[LIMIT - 1], MOD - 2, MOD);
        for (int i = LIMIT - 2; i >= 0; i--) {
            inv[i] = inv[i + 1] * (i + 1) % MOD;
        }
        long res = 0;
        for (int i = 1; i <= n; i++) {
            int cnt = n / i;
            int need = k - 1;
            if (cnt - 1 >= need) {
                res += comb(cnt - 1, need);
                if (res >= MOD) {
                    res -= MOD;
                }
            }
        }
        outln(res % MOD);
    }

    // Power Calculate N^M % MOD, N and M can be long (up to 2^64, ~10^18)
    public long powMod(long N, long M, long MOD){//N^M % MOD
        if(M == 0L)
            return 1L;
        long[] hp = new long[64];
        boolean[] bp = new boolean[64];
        hp[0] = N;
        for(int i = 1; i < hp.length; i++) {
            hp[i] = (hp[i - 1] * hp[i - 1]) % MOD;
        }
        for(int j = 0; j < hp.length; j++) {
            if((M & (1L << j)) != 0)
                bp[j] = true;
        }
        long res = 1;
        for(int i = 0;i < bp.length; i++){
            if(bp[i]) {
                res = (res * hp[i]) % MOD;
            }
        }
        return res;
    }

    long comb(int n, int k) {
        long res = fact[n] * inv[k] % MOD;
        res = res * inv[n - k] % MOD;
        return res;
    }

    void shuffle(long[] a) {
        int n = a.length;
        for(int i = 0; i < n; i++) {
            int r = i + (int) (Math.random() * (n - i));
            long tmp = a[i];
            a[i] = a[r];
            a[r] = tmp;
        }
    }
    long gcd(long a, long b) {
        while(a != 0 && b != 0) {
            long c = b;
            b = a % b;
            a = c;
        }
        return a + b;
    }
    private void outln(Object o) {
        out.println(o);
    }
    private void out(Object o) {
        out.print(o);
    }
    private void formatPrint(double val) {
        outln(String.format("%.9f%n", val));
    }
    public CFA() throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        solve();
        out.close();
    }
    public static void main(String[] args) throws IOException {
        new CFA();
    }

    public long[] nextLongArr(int n) throws IOException{
        long[] res = new long[n];
        for(int i = 0; i < n; i++)
            res[i] = nextLong();
        return res;
    }
    public int[] nextIntArr(int n) throws IOException {
        int[] res = new int[n];
        for(int i = 0; i < n; i++)
            res[i] = nextInt();
        return res;
    }
    public String nextToken() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                eof = true;
                return null;
            }
        }
        return st.nextToken();
    }
    public String nextString() {
        try {
            return br.readLine();
        } catch (IOException e) {
            eof = true;
            return null;
        }
    }
    public int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }
    public long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }
    public double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }
}


import java.util.Scanner;

public class _4_Venya_ {

	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int n = scn.nextInt();
		if (n % 2 == 0) {
			System.out.println("white");
			System.out.println(1 + " " + 2);
		} else {
System.out.println("black");
		}
	}

}


import java.util.Scanner;
import java.math.BigInteger;
import java.util.Vector;

public class TrivialProblem
{
    public static void main(String[] args)
    {
        Scanner clavier=new Scanner(System.in);
        Vector vec=new Vector();
        int m=clavier.nextInt();
        if(m==0){ System.out.println(5); System.out.println("0 1 2 3 4");}
        else
        {
            int t=0;  int j=4;int p=j/5;
            while(t<m)
            {
                t=0;
                j++;
                p=j/5;
                while(p>=1)
                {
                    t+=p;
                    p/=5;
                }
            }
            int a=0;
            while(t==m)
            {
                a++;
                t=0;
                vec.add(j);
                j++;
                p=j/5;
                while(p>=1)
                {
                    t+=p;
                    p/=5;
                }

            }
            System.out.println(a);
            for(int k=0;k<vec.size();k++)
            {
                System.out.print(vec.get(k)+" ");
            }
        }
    }
}


import java.util.*;
public class remove_duplicates
{
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n=in.nextInt();
		int arr[]=new int[n];
		Set<Integer> set = new LinkedHashSet<>();
		for(int i=0;i<n;i++)
			arr[i]=in.nextInt();
		for(int i=n-1;i>=0;i--)
			set.add(arr[i]);
		System.out.println(set.size());
		ArrayList<Integer> list = new ArrayList<Integer>();
		for(int i:set)
			list.add(i);
		Collections.reverse(list);
		for(int i:list)
			System.out.print(i+" ");
	}
}


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

public class Solution {

    public static void solve(InputReader in, PrintWriter out, DebugWriter debug) throws IOException {
        long n = in.nextInt();
        long m = in.nextInt();
        long k = in.nextInt();

        long x = Math.max(0, m - (n - n % k) / k * (k-1) - n % k);

        long scoreNoSerial = m-x*k;
        long scoreSerial = ((pow2(x)-1)*k*2) % mod ;

        debug.println(x);
        debug.println(scoreNoSerial);
        debug.println(scoreSerial);

        out.println((scoreSerial+scoreNoSerial) % mod);
    }

    public static long mod = (long) Math.pow(10, 9)+9;

    public static long pow2(long x){
        long[] array2 = new long[64];
        array2[0] = 2;

        for (int i=1; i<array2.length; i++){
            array2[i] = (array2[i-1]*array2[i-1]) % mod;
            //System.out.println( i + ": " + array2[i]);
        }

        long ans = 1;
        String binary = Long.toBinaryString(x);
        //System.out.println("Bin: " + binary);
        for (int i=binary.length()-1; i>=0; i--){
            if (binary.charAt(i) == '1'){
                ans *= array2[binary.length()-1-i];
                ans %= mod;
            }
        }

        //System.out.println("2^" + x + "=" + ans);
        return ans;
    }

    public static void main(String[] args) throws IOException{
        InputReader in;
        PrintWriter out;
        DebugWriter debug;

        if (args.length > 0 && args[0].equals("file")) {
            in = new InputReader(new BufferedReader(new FileReader("input.txt")));
            out = new PrintWriter(new FileWriter("output.txt"));
            debug = new DebugWriter(true);

            int sampleNumber = 1;
            do {
                String nextSample = "Sample #" + sampleNumber++ + ": ";
                out.println(nextSample);
                debug.println(nextSample);

                solve(in, out, debug);

                out.println("");
                debug.println("");
            } while (in.reader.readLine() != null);
        } else {
            in = new InputReader(new BufferedReader(new InputStreamReader(System.in)));
            out = new PrintWriter(new OutputStreamWriter(System.out));
            debug = new DebugWriter(false);

            solve(in, out, debug);
        }

        in.reader.close();
        out.close();
    }

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

        public InputReader(BufferedReader reader) {
            this.reader = reader;
            tokenizer = null;
        }

        public String next() throws IOException{
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                tokenizer = new StringTokenizer(reader.readLine());
            }

            return tokenizer.nextToken();
        }

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

        public int[] nextIntArray(int n) throws IOException{
            int[] array = new int[n];
            for (int i=0; i<n; i++){
                array[i] = nextInt();
            }

            return array;
        }
    }

    public static class DebugWriter {
        public boolean enable;

        public DebugWriter(boolean enable){
            this.enable = enable;
        }

        public void print(Object o){
            if (enable) System.out.print(o);
        }

        public void println(Object o){
            if (enable) System.out.println(o);
        }
    }

}


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

public class btest9
{
	public static void main(String[] args) throws Exception
	{
		InputReader in = new InputReader(System.in);
		OutputWriter out = new OutputWriter(System.out);
		int n=in.readInt();
		int a[]=new int[n];
		for(int i=0;i<n;i++)a[i]=in.readInt();
		int k=in.readInt();
		Arrays.sort(a);
		int lo,hi,mid;
		int fi=0;
		int ans=0;
		int max=-5;
		for(int i=0;i<n;i++)
		{
			lo=i+1;hi=n-1;fi=a[i]+k;
			while(lo<hi)
			{
				mid=lo+(hi-lo+1)/2;
				if(a[mid]>fi)hi=mid-1;
				else lo=mid;
			}
			if(lo<n&&a[lo]<=fi)ans=lo-i+1;
			else ans=1;
			if(ans>max)max=ans;
		}
		out.printLine(max);
		out.close();
	}

	private static 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 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 c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

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

	private static class OutputWriter
	{
		private final PrintWriter writer;

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

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

		public void printf(double n)
		{
			writer.printf("%.4f%n", n);
		}
		public void printLine(Object... objects)
		{
			print(objects);
			writer.println();
		}

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

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

	}
}


import java.util.Scanner;

public class A336 {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		long x = in.nextLong();
		long y = in.nextLong();
		if (x * y > 0) {
			long sum = x + y;
			if (x > 0) {
				System.out.println("0 " + sum + " " + sum + " 0");
			} else {
				System.out.println(sum + " 0 0 " + sum);
			}
		} else {
			long sum = x - y;
			if (x > 0) {
				System.out.println("0 " + (-sum) + " " + (sum) + " 0");
			} else {
				System.out.println(sum + " 0 0 " + (-sum) + " ");
			}
		}

	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;

public class A {
	BufferedReader reader;
    StringTokenizer tokenizer;
    PrintWriter out;

    int INF = Integer.MAX_VALUE/2;
    int STOP = 2000000;

    int N;
    int M;
    int I;
    int J;
    int A;
    int B;
	public void solve() throws IOException {
		N = nextInt();
		M = nextInt();
		I = nextInt();
		J = nextInt();
		A = nextInt();
		B = nextInt();

		int ans = INF;
		ans = Math.min(ans, go(1, 1));
		ans = Math.min(ans, go(1, M));
		ans = Math.min(ans, go(N, 1));
		ans = Math.min(ans, go(N, M));

		if (ans == INF) {
			out.println("Poor Inna and pony!");
		} else {
			out.println(ans);
		}
	}

	public int go(int targetX, int targetY) {
		int curX = I;
		int curY = J;
		int ans = 0;
		while (true) {
			if (curX == targetX && curY == targetY) {
				return ans;
			}

			if (curX + A > N && curX - A < 1) {
				return INF;
			}
			if (curY + B > M && curY - B < 1) {
				return INF;
			}

			if (curX + A > N) {
				curX -= A;
			} else if(curX - A < 1) {
				curX += A;
			} else {
				if (curX <= targetX) {
					curX += A;
				} else {
					curX -= A;
				}
			}

			if (curY + B > M) {
				curY -= B;
			} else if(curY - B < 1) {
				curY += B;
			} else {
				if (curY <= targetY) {
					curY += B;
				} else {
					curY -= B;
				}
			}

			ans++;
			if (ans == STOP) {
				return INF;
			}
		}
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		new A().run();
	}

	public void run() {
        try {
            reader = new BufferedReader(new InputStreamReader(System.in));
            tokenizer = null;
            out = new PrintWriter(System.out);
            solve();
            reader.close();
            out.close();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
    }

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

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

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

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

}


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

public class Main {

	private void solve() throws IOException {

		int lfg = nextInt();
		int rfg = nextInt();
		int lfb = nextInt();
		int rfb = nextInt();

		if ( (can(lfg,rfb))||(can(rfg,lfb)) ){
			out.println("YES");
		}else{
			out.println("NO");
		}
	}
	private boolean can(int g, int b) {
		if( (b >= (g-1)) && ( g >= (b/2 + b%2-1) )  )
			return true;
		return false;
	}
	private BufferedReader in;
	private PrintWriter out;
	private StringTokenizer st;

	private Main() throws IOException {
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(new OutputStreamWriter(System.out));
		eat("");
		solve();
		in.close();
		out.close();
	}

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

	private void eat(String s) {
		st = new StringTokenizer(s);
	}

	String next() throws IOException {
		while (!st.hasMoreTokens()) {
			String line = in.readLine();
			if (line == null) {
				return null;
			}
			eat(line);
		}
		return st.nextToken();
	}

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

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

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


import java.util.Scanner;

public class Lucky {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		long num = scan.nextLong();
		System.out.println(num/2520);
	}

}


//package com.example.practice.codeforces;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.StringTokenizer;

public class Solution {
    public static void main (String [] args) throws IOException {
        // Use BufferedReader rather than RandomAccessFile; it's much faster
        final BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        // input file name goes above
        //StringTokenizer st = new StringTokenizer(input.readLine());
        //int n = Integer.parseInt(st.nextToken()), a = Integer.parseInt(st.nextToken()), b = Integer.parseInt(st.nextToken()), k = Integer.parseInt(st.nextToken());
        long[] res = calc(input.readLine());
        if (res==null){
            out.println(-1);
        }else {
            printArray(res, out);
        }
        out.close();       // close the output file
    }

    private static long[] calc(final String s) {
        long px = 0, v = 1;
        int p = s.length()-1, tem = 0, highest = 0, first = 0, c = 0;
        while (p>=0 && s.charAt(p)=='0'){
            p--;
        }
        if (p<0)return null;
        while (p>=0){
            if (s.charAt(p)=='1'){
                px |= 1L << tem;
                highest = tem;
                first = p;
                c++;
            }
            tem++;
            p--;
        }
        if (c==1)return new long[]{first+1, first+2};
        final long m = (long) Math.sqrt(1L<<highest) + 1;
        HashMap<Long, Long> map = new HashMap<>();
        for (int i=1;i<=m;++i){
            v = v << 1;
            if ((v & (1L<<highest)) != 0){
                v = v ^ px;
            }
            if (v == 1){
                return new long[]{first+1, first+1+i};
            }
            if (i<m){
                map.put(v, (long)i);
            }
        }
        final long d = v;
        for (int i=2;i<=m;++i){
            v = multi(px, v, d, highest);
            if (v==1){
                return new long[]{first + 1, first + 1 + m * i};
            }
            Long j = map.get(v);
            if (j != null){
                return new long[]{first + 1, first + 1 + m * i - j};
            }
        }
        return null;
    }

    private static long multi(final long px, final long v, final long d, final int highest){
        long res = 0;
        for (int i=0;i<highest;++i){
            if ((d & (1L<<i)) != 0) {
                int t = i;
                long v2 = v;
                while (t > 0) {
                    v2 = v2 << 1;
                    if ((v2 & (1L<<highest)) != 0){
                        v2 = v2 ^ px;
                    }
                    t--;
                }
                res = res ^ v2;
            }
        }
        return res;
    }

    private static void printArray(long[] ns, final PrintWriter out){
        for (int i=0;i<ns.length;++i){
            out.print(ns[i]);
            if (i+1<ns.length)out.print(" ");
            else out.println();
        }
    }

    private static void printArrayInt(int[] ns, final PrintWriter out){
        for (int i=0;i<ns.length;++i){
            out.print(ns[i]);
            if (i+1<ns.length)out.print(" ");
            else out.println();
        }
    }

    private static void printArrayVertical(long[] ns, final PrintWriter out){
        for (long a : ns){
            out.println(a);
        }
    }

    private static void printArray2D(long[][] ns, final int len, final PrintWriter out){
        int cnt = 0;
        for (long[] kk : ns){
            cnt++;
            if (cnt > len)break;
            for (int i=0;i<kk.length;++i){
                out.print(kk[i]);
                if (i+1<kk.length)out.print(" ");
                else out.println();
            }
        }
    }

    private static void printArray2DInt(int[][] ns, final int len, final PrintWriter out){
        int cnt = 0;
        for (int[] kk : ns){
            cnt++;
            if (cnt > len)break;
            for (int i=0;i<kk.length;++i){
                out.print(kk[i]);
                if (i+1<kk.length)out.print(" ");
                else out.println();
            }
        }
    }

    private static long[] readArray(final int n, final BufferedReader input) throws IOException{
        long[] ns = new long[n];
        StringTokenizer st = new StringTokenizer(input.readLine());
        for (int i=0;i<n;++i){
            ns[i] = Long.parseLong(st.nextToken());
        }
        return ns;
    }

    private static int[] readArrayInt(final int n, final BufferedReader input) throws IOException{
        int[] ns = new int[n];
        StringTokenizer st = new StringTokenizer(input.readLine());
        for (int i=0;i<n;++i){
            ns[i] = Integer.parseInt(st.nextToken());
        }
        return ns;
    }

    private static long[] readArrayVertical(final int n, final BufferedReader input) throws IOException{
        long[] ns = new long[n];
        for (int i=0;i<n;++i){
            ns[i] = Long.parseLong(input.readLine());
        }
        return ns;
    }

    private static long[][] readArray2D(final int n, final int len, final BufferedReader input) throws IOException{
        long[][] ns = new long[len][];
        for (int i=0;i<n;++i){
            StringTokenizer st = new StringTokenizer(input.readLine());
            ArrayList<Long> al = new ArrayList<>();
            while (st.hasMoreTokens()){
                al.add(Long.parseLong(st.nextToken()));
            }
            long[] kk = new long[al.size()];
            for (int j=0;j<kk.length;++j){
                kk[j] = al.get(j);
            }
            ns[i] = kk;
        }
        return ns;
    }

    private static int[][] readArray2DInt(final int n, final int len, final BufferedReader input) throws IOException{
        int[][] ns = new int[len][];
        for (int i=0;i<n;++i){
            StringTokenizer st = new StringTokenizer(input.readLine());
            ArrayList<Integer> al = new ArrayList<>();
            while (st.hasMoreTokens()){
                al.add(Integer.parseInt(st.nextToken()));
            }
            int[] kk = new int[al.size()];
            for (int j=0;j<kk.length;++j){
                kk[j] = al.get(j);
            }
            ns[i] = kk;
        }
        return ns;
    }

    static class SegTree{
        int st;
        int en;
        int mid;
        int val1;
        int val2;
        SegTree left;
        SegTree right;
        public SegTree(int l, int r, int d){
            st = l;
            en = r;
            mid = (st + en) >> 1;
            val1 = val2 = d;
            if (st<en){
                left = new SegTree(st, mid, d);
                right = new SegTree(mid+1, en, d);
            }else {
                left = right = null;
            }
        }

        public SegTree(int l, int r, int[] ns){
            st = l;
            en = r;
            mid = (st + en) >> 1;
            if (st==en){
                val1 = val2 = ns[st];
            }else {
                left = new SegTree(l, mid, ns);
                right = new SegTree(mid+1, r, ns);
                val1 = Math.min(left.val1, right.val1);
                val2 = Math.max(left.val2, right.val2);
            }
        }

        void update(int idx, int v){
            if (st==en){
                val1 = val2 = v;
            }else {
                if (idx <= mid){
                    left.update(idx, v);
                }else {
                    right.update(idx, v);
                }
                val1 = Math.min(left.val1, right.val1);
                val2 = Math.max(left.val2, right.val2);
            }
        }

        int getMin(int l, int r){
            if (st==en || (l==st && r==en))return val1;
            if (r<=mid){
                return left.getMin(l, r);
            }
            if (l>mid){
                return right.getMin(l, r);
            }
            return Math.min(left.getMin(l, mid), right.getMin(mid+1, r));
        }

        int getMax(int l, int r){
            if (st==en || (l==st && r==en))return val2;
            if (r<=mid){
                return left.getMax(l, r);
            }
            if (l>mid){
                return right.getMax(l, r);
            }
            return Math.max(left.getMax(l, mid), right.getMax(mid+1, r));
        }
    }

    static class SparseTable{
        int[][] minTable;
        int[][] maxTable;
        int[] log2;
        int n;
        public SparseTable(final int[] ns){
            n = ns.length;
            int m = 0, pre = 0;
            while (1<<m < n){
                m++;
            }
            m++;
            minTable = new int[n][m];
            maxTable = new int[n][m];
            log2 = new int[n+1];
            for (int i=0;i<n;++i){
                minTable[i][0] = ns[i];
                maxTable[i][0] = ns[i];
                if ((1<<(pre+1)) == i+1){
                    pre++;
                }
                log2[i+1] = pre;
            }
            for (int i=1;i<m;++i){
                for (int j=0;j<n;++j){
                    int r = Math.min(n-1, j+(1<<i)-1);
                    if (r-(1<<(i-1))+1 <= j){
                        minTable[j][i] = minTable[j][i-1];
                        maxTable[j][i] = maxTable[j][i-1];
                    }else {
                        minTable[j][i] = Math.min(minTable[j][i-1], minTable[r-(1<<(i-1))+1][i-1]);
                        maxTable[j][i] = Math.max(maxTable[j][i-1], maxTable[r-(1<<(i-1))+1][i-1]);
                    }
                }
            }
        }

        int getMin(final int l, final int r){
            int d = log2[r-l+1];
            return Math.min(minTable[l][d], minTable[r-(1<<d)+1][d]);
        }

        int getMax(final int l, final int r){
            int d = log2[r-l+1];
            return Math.max(maxTable[l][d], maxTable[r-(1<<d)+1][d]);
        }
    }
}


import java.util.*;

import java.io.*;
public class Main {
		static long mod = 1000000007;
		static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
		public static void main(String[] args) throws IOException  {
			FastReader sc = new FastReader();
			int t = sc.nextInt();
			while( t-- > 0) {
				int n = sc.nextInt();
				int k =sc.nextInt();
				// n^k
				long ans = 1;
				for( int i =0 ; i< k;i++) {
					ans*=n;
					ans%=mod;
				}
				out.println(ans);
			}
			out.flush();
		}

		public static int[] nextLargerElement(int[] arr, int n)	{
			Stack<Integer> stack = new Stack<>();
			int rtrn[] = new int[n];
	        rtrn[n-1] = -1;
	        stack.push( n-1);
	        for( int i = n-2 ;i >= 0 ; i--){
	            int temp = arr[i];
	            int lol = -1;
	            while( !stack.isEmpty() && arr[stack.peek()] <= temp){
	            	if(arr[stack.peek()] == temp ) {
	            		lol = stack.peek();
	            	}
	                stack.pop();
	            }
	            if( stack.isEmpty()){
	            	if( lol != -1) {
	            		rtrn[i] = lol;
	            		}
	            	else {
	                rtrn[i] = -1;
	            	}
	            }
	            else{
	            	rtrn[i] = stack.peek();
	            }
	            stack.push( i);
	        }
	        return rtrn;
			}

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

			    // method to return LCM of two numbers
		 static int lcm(int a, int b)
		 {
			 return (a / gcd(a, b)) * b;
		 }

		static HashMap<Long,Long> primefactor( long n){
			HashMap<Long ,Long> hm = new HashMap<>();
			long temp = 0;
			while( n%2 == 0) {
				temp++;
				n/=2;
	 		 }
			if( temp!= 0) {
	 			 hm.put( 2L, temp);
	 		 }
	 		 long c = (long)Math.sqrt(n);
	 		 for( long i = 3 ; i <= c ; i+=2) {
	 			 temp = 0;
	 			 while( n% i == 0) {
	 				 temp++;
	 				 n/=i;
	 			 }
	 			 if( temp!= 0) {
	 				 hm.put( i, temp);
	 			 }
	 		 }
	 		 if( n!= 1) {
	 			 hm.put( n , 1L);
	 		 }
	 		 return hm;
	 		// this is the link where i found this method
	 		 // https://www.geeksforgeeks.org/print-all-prime-factors-of-a-given-number/
	 	 }

		 static class FastReader {
		        BufferedReader br;
		        StringTokenizer st;

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

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

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

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

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

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

}


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

public class C {

    final static int M = 1000000007;
    final static int K = 25997;
    final static int N = 300000;

    boolean[] p = new boolean[N];
    int l[] = new int[K];

    int cnt = 0;
    void solve() throws IOException {
        in("__std"); out("__std");

        int k = 0;
        for (int i = 2; i < N; ++i) {
            if (!p[i]) {
                l[k++] = i;
                int j = i << 1;
                while (j < N) {
                    p[j] = true;
                    j += i;
                }
            }
        }

        int n = readInt();
        int n2 = 2 * n;
        long r = 1;
        for (int i = 0; i < K; ++i) {
            k = calc(n2, l[i]) - calc(n, l[i]) * 2;
            if (k > 0) {
                r = (r * pow(l[i], k)) % M;
            }
        }

        r -= n;
        if (r < 0) {
            r += M;
        }
        println(r);

        exit();
    }

    int calc(int n, int p) {
        int r = 0;
        long k = p;
        while (k <= n) {
            r += n / k;
            k *= p;
        }
        return r;
    }

    long pow(int b, int p) {
        if (p == 1) {
            return b;
        }
        long r = pow(b, p / 2);
        r = (r * r) % M;
        if ((p & 1) == 1) {
            r = (r * b) % M;
        }
        return r;
    }

    void in(String name) throws IOException {
        if (name.equals("__std")) {
            in = new BufferedReader(new InputStreamReader(System.in));
        } else {
            in = new BufferedReader(new FileReader(name));
        }
    }

    void out(String name) throws IOException {
        if (name.equals("__std")) {
            out = new PrintWriter(System.out);
        } else {
            out = new PrintWriter(name);
        }
    }

    void exit() {
        out.close();
        System.exit(0);
    }

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

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

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

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

    boolean eof() throws IOException {
        return !in.ready();
    }

    void print(String format, Object ... args) {
        out.println(new Formatter().format(format, args));
    }

    void println(String format, Object ... args) {
        out.println(new Formatter().format(format, args));
    }

    void print(Object value) {
        out.print(value);
    }

    void println(Object value) {
        out.println(value);
    }

    void println() {
        out.println();
    }

    StringTokenizer st;

    BufferedReader in;
    PrintWriter out;

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


import java.util.Scanner;
public class codefo {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner ob =new Scanner(System.in);
		int n=ob.nextInt();
		ob.nextLine();
		String s=ob.nextLine();
		String sub[]=new String[n-1];
		for(int i=0;i<n-1;i++)
		{
			String se=s.substring(i, i+2);
			sub[i]=se;
		}
		int c=0,index=0,max=0;
		for(int i=0;i<n-1;i++)
		{
			c=0;
			for(int j=i+1;j<n-1;j++)
			{
				if(sub[i].compareTo(sub[j])==0)
					c++;
			}
			if(c>max)
			{
				max=c;
				index=i;
			}
		}
		System.out.println(sub[index]);
		ob.close();
		}
	}


import java.util.*;
import java.io.*;
import java.lang.*;
import java.math.*;
import static java.lang.Math.*;
import java.util.concurrent.ThreadLocalRandom;

public class Sol implements Runnable {

    long mod = (long)1e9 + 7;

    void solve(InputReader in, PrintWriter w) {
        long n = in.nextLong();
        long k = in.nextLong();
        long M = in.nextLong();
        long D = in.nextLong();

        long max = M;
        long limit = (long)1e18;

        for(long i=2;i<=D;i++) {
            if(limit / k < i - 1L) break;
            long maxPossible = n / (k * (i - 1L) + 1L);
            maxPossible = min(maxPossible, M);
            long total = maxPossible * i;
            max = max(max, total);
        }

        w.println(max);
    }

    // ************* Code ends here ***************

    void init() throws Exception {
        //Scanner in;
        InputReader in;
        PrintWriter w;
        boolean online = false;

        String common_in_fileName = "\\in";
        String common_out_fileName = "\\out";
        int test_files = 0;

        for(int file_no = 0; file_no <= test_files; file_no++) {

            String x = "" + file_no;
            if (x.length() == 1) x = "0" + x;

            String in_fileName = common_in_fileName;// + "" + x;
            String out_fileName = common_out_fileName;// + "" + x;

            if (online) {
                //in = new Scanner(new File(in_fileName + ".txt"));
                in = new InputReader(new FileInputStream(new File(in_fileName + ".txt")));
                w = new PrintWriter(new FileWriter(out_fileName + ".txt"));
            } else {
                //in = new Scanner(System.in);
                in = new InputReader(System.in);
                w = new PrintWriter(System.out);
            }

            solve(in, w);
            w.close();
        }
    }

    public void run() {
        try {
            init();
        }
        catch(Exception e) {
            System.out.println(e);
            e.printStackTrace();
        }
    }

    public static void main(String args[]) throws Exception {
        new Thread(null, new Sol(),"Sol",1<<28).start();
    }

    static 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 String nextLine() {
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        public int nextInt() {
            int c = read();

            while (isSpaceChar(c)) {
                c = read();
            }

            int sgn = 1;

            if (c == '-') {
                sgn = -1;
                c = read();
            }

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

            return res * sgn;
        }

        public 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 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 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 c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

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

        public interface SpaceCharFilter {

            public boolean isSpaceChar(int ch);
        }
    }
}


/* package codechef; // don't place package name! */

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

/* Name of the class has to be "Main" only if the class is public. */
public class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here
		MyScanner sc = new MyScanner();
		int n = sc.nextInt();
		int m = sc.nextInt();
		long k = sc.nextLong();
		int x = sc.nextInt();
		int y = sc.nextInt();
		long best = -1;
		long wor = k+1;
		long ser = 0l;
		long[][] count = new long[n+1][m+1];
		for (int i = 1; i <= n; ++i){
		    for (int j = 1; j <= m; ++j){
		        if (n == 1){
		            long total = (long) n * (long) m;
		            long pre = k / total;
		            long k1 = k - pre * total;
		            total = k % total;
		            count[i][j] += pre;

		            if (In(i, j, total, n, m, k1)){
		                count[i][j]++;
		            }
		        }else{
		            long total = (long) n * (long) m;

		            if (k <= total){
		              //  System.out.println("i:" + i + " j:" + j + " total:" + total + " k: " + k);
		                if (In(i, j, total, n, m, k)){
		                    count[i][j]++;
		                }
		            }else{
		                long k1 = k - total;
		                total = (long) (n-1) * (long) m;
		                long pre = 1L + k1 / total;
		                long k2 = k1 - (pre-1) * total;
		                total = k1 % total;

		                if (i != n && i != 1)
	                        count[i][j]+=pre;
	                    else{
	                        count[i][j] += (pre-1) / 2 + 1L;
	                        if (i == 1){
	                            count[i][j] += ((pre-1) % 2);
	                        }
	                    }
	                   // if (i == 24 && j == 49)
	                   //     System.out.println("i:" + i + " j:" + j + " pre: " + pre + " total:" + total + " k2: " + k2 + " count " + count[i][j]);
		                if (pre % 2 == 0){
		                    if (In1(i, j, total, n, m, k2)){
		                        count[i][j]++;
		                    }
		                }
		                else
		                {

	                        if (In2(i,j, total, n, m, k2)){
	                            count[i][j]++;
	                        }
	                    }
		            }
		        }
		    }
		}
		for (int i = 1; i <= n;++i){
		    for (int j = 1; j <= m; ++j){
		        best = Math.max(best, count[i][j]);
		        wor = Math.min(wor, count[i][j]);
		    }
		}

		System.out.println(best + " " + wor + " " + count[x][y]);

	}

	public static boolean In(int x, int y, long total, int n, int m, long k){
	    if (total == 0) return false;
	    long cur = 0L;

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

	        if (cur >= k){

	            cur -= (long) m;

	            total = k - cur;
	            //System.out.println(cur + " " + k + " " + x + " " + y + " " +total);
	            if (x < i){
	                return true;
	            }else if (x == i){
	                return y <= total;
	            }else{
	                return false;
	            }
	        }
	    }
	    return false;
	}

	public static boolean In1(int x, int y, long total, int n, int m, long k){
	   // System.out.println("Check in1 " + x + " " + y + " total: " + total + " " + n + " " + m + " k: " + k);
	   if (total == 0) return false;
	    long cur = 0L;
	    if (x < 2) return false;
	    for (int i = 2; i <= n; ++i){
	        cur += (long) m;

	        if (cur >= k){
	            cur -= m;
	            total = k - cur;
	            if (x < i){
	                return true;
	            }else if (x == i){
	                return y <= total;
	            }else{
	                return false;
	            }
	        }
	    }
	    return false;
	}

	public static boolean In2(int x, int y, long total, int n, int m, long k){
	   // System.out.println("Check in2 " + x + " " + y + " total: " + total + " " + n + " " + m + " k: " + k);
	   if (total == 0) return false;
	    long cur = 0L;
	    if (x > n-1) return false;
	    for (int i = n-1; i >= 1; --i){
	        cur += (long) m;

	        if (cur >= k){
	            cur -= m;
	            total = k - cur;
	            if (x > i){
	                return true;
	            }else if (x == i){
	                return y <= total;
	            }else{
	                return false;
	            }
	        }
	    }
	    return false;
	}

    //-----------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;
      }

   }
}


import java.util.*;

public class cf376b {
	public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		int size = scan.nextInt();
		long[] nums = new long[size];
		for (int i = 0; i < size; i++) {
			nums[i] = scan.nextLong();
		}
		Arrays.sort(nums);
		long ans = nums[size - 1];
		for (int i = nums.length - 2; i >= 0; i--) {
			if (nums[i] < nums[i + 1]) {
				ans += nums[i];
			} else {
				if (nums[i + 1] - 1 > 0) {
					nums[i] = nums[i + 1] - 1;
					ans += nums[i + 1] - 1;
				}
				else{
					break;
				}
			}
		}
		System.out.println(ans);
	}
}


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

public class Solution {
    private IO io;
    private int ioMode = -1;
    private String problemName = "";
    private final String mjArgument = "master_j";

    public static void main(String programArguments[]) throws IOException{
        if(programArguments != null && programArguments.length > 0)
            new Solution().run(programArguments[0]);
        else
            new Solution().run(null);
    }

    private void run(String programArgument) throws IOException {
        //         _______________________________________________ _________
        //        |   Input Mode     |      Output Mode    | mode | comment |
        //        |------------------|---------------------|----- |---------|
        //        |   input.txt      |      System.out     |  0   |    mj   |
        //        |   System.in      |      System.out     |  1   |  T / CF |
        //        |<problemName>.in  |  <problemName>.out  |  2   |         |
        //        |   input.txt      |      output.txt     |  3   |    C    |
        //        |__________________|_____________________|______|_________|
        long nanoTime = 0;
        if(programArgument != null && programArgument.equals(mjArgument)) // mj
            ioMode = 0;
        else if(System.getProperty("ONLINE_JUDGE") != null) // T / CF
            ioMode = 1;
        else
            ioMode = 2;
        switch(ioMode){
            case -1:
                try{
                    throw new Exception("<ioMode> init failure") ;
                }catch (Exception e){
                    e.printStackTrace();
                }
                return;
            case 0:
                break;
            case 1:
                break;
            case 2:
                if(problemName.length() == 0){
                    try{
                        throw new Exception("<problemName> init failure");
                    }catch (Exception e){
                        e.printStackTrace();
                    }
                    return;
                }
            case 3:
                break;
        }
        io = new IO(ioMode, problemName);
        if(ioMode == 0){
            System.out.println("File output : \n<start>");
            System.out.flush();
            nanoTime = System.nanoTime();
        }
        solve();
        io.flush();
        if(ioMode == 0){
            System.out.println("</start>");
            long t = System.nanoTime() - nanoTime;
            int d3 = 1000000000, d2 = 1000000, d1 = 1000;
            if(t>=d3)
                System.out.println(t/d3 + "." + t%d3 + " seconds");
            else if(t>=d2)
                System.out.println(t/d2 + "." + t%d2 + " millis");
            else if(t>=d1)
                System.out.println(t/d1 + "." + t%d1 + " micros");
            else
                System.out.println(t + " nanos");
            System.out.flush();
        }
    }

    private void solve() throws IOException {
        double r = io.nI(), h = io.nI();
        long ans = 0;
        while(h > r){
            h -= r;
            ans++;
        }
        if(h >= r/2){
            //h -= r/2;
            ans++;
        }else
            h += r;
        //h += r/2;
        ans *= 2;
        if(dist(0, 0, r/2, h) >= r)
            ans++;
        io.wln(ans);
    }//2.2250738585072012e-308

    double dist(double y1, double z1, double y2, double z2){
        double d1 = (y1-y2)*(y1-y2);
        double d2 = (z1-z2)*(z1-z2);
        double d = d1 + d2;
        return sqrt(d);
    }

    /**
     * Input-output class
     * @author master_j
     * @version 0.2.5
     */
    @SuppressWarnings("unused")
    private class IO{
        private boolean alwaysFlush;
        StreamTokenizer in; PrintWriter out; BufferedReader br; Reader reader; Writer writer;
        public IO(int ioMode, String problemName) throws IOException{
            Locale.setDefault(Locale.US);
            //         _______________________________________________ _________
            //        |   Input Mode     |      Output Mode    | mode | comment |
            //        |------------------|---------------------|----- |---------|
            //        |   input.txt      |      System.out     |  0   |    mj   |
            //        |   System.in      |      System.out     |  1   |  T / CF |
            //        |<problemName>.in  |  <problemName>.out  |  2   |         |
            //        |   input.txt      |      output.txt     |  3   |    C    |
            //        |__________________|_____________________|______|_________|
            switch(ioMode){
                case 0:
                    reader = new FileReader("input.txt");
                    writer = new OutputStreamWriter(System.out);
                    break;
                case 1:
                    reader = new InputStreamReader(System.in);
                    writer = new OutputStreamWriter(System.out);
                    break;
                case 2:
                    reader = new FileReader(problemName + ".in");
                    writer = new FileWriter(problemName + ".out");
                    break;
                case 3:
                    reader = new FileReader("input.txt");
                    writer = new FileWriter("output.txt");
                    break;
            }
            br = new BufferedReader(reader);
            in = new StreamTokenizer(br);
            out = new PrintWriter(writer);
            alwaysFlush = false;
        }
        public void setAlwaysFlush(boolean arg){alwaysFlush = arg;}
        public void wln(){out.println(); if(alwaysFlush)flush();}
        public void wln(int arg){out.println(arg); if(alwaysFlush)flush();}
        public void wln(long arg){out.println(arg); if(alwaysFlush)flush();}
        public void wln(double arg){out.println(arg); if(alwaysFlush)flush();}
        public void wln(String arg){out.println(arg); if(alwaysFlush)flush();}
        public void wln(boolean arg){out.println(arg); if(alwaysFlush)flush();}
        public void wln(char arg){out.println(arg); if(alwaysFlush)flush();}
        public void wln(float arg){out.println(arg); if(alwaysFlush)flush();}
        public void wln(Object arg){out.println(arg); if(alwaysFlush)flush();}
        public void w(int arg){out.print(arg); if(alwaysFlush)flush();}
        public void w(long arg){out.print(arg); if(alwaysFlush)flush();}
        public void w(double arg){out.print(arg); if(alwaysFlush)flush();}
        public void w(String arg){out.print(arg); if(alwaysFlush)flush();}
        public void w(boolean arg){out.print(arg); if(alwaysFlush)flush();}
        public void w(char arg){out.print(arg); if(alwaysFlush)flush();}
        public void w(float arg){out.print(arg); if(alwaysFlush)flush();}
        public void w(Object arg){out.print(arg); if(alwaysFlush)flush();}
        public void wf(String format, Object...args){out.printf(format, args); if(alwaysFlush)flush();}
        public void flush(){out.flush();}
        public int nI() throws IOException {in.nextToken(); return(int)in.nval;}
        public long nL() throws IOException {in.nextToken(); return(long)in.nval;}
        public String nS() throws IOException {in.nextToken(); return in.sval;}
        public double nD() throws IOException {in.nextToken(); return in.nval;}
        public float nF() throws IOException {in.nextToken(); return (float)in.nval;}
        public char nC() throws IOException {return (char)br.read();}
        public void wc(char...arg){for(char c : arg){in.ordinaryChar(c);in.wordChars(c, c);}}
        public void wc(String arg){wc(arg.toCharArray());}
        public void wc(char arg0, char arg1){in.ordinaryChars(arg0, arg1); in.wordChars(arg0, arg1);}
        public boolean eof(){return in.ttype == StreamTokenizer.TT_EOF;}
        public boolean eol(){return in.ttype == StreamTokenizer.TT_EOL;}
    }
}


// CF 0040
import java.util.*;
public class Main {
	Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		new Main().C();
	}
	void C()
	{
		String input = sc.next();
		StringBuilder adr = new StringBuilder(input);
		int idx = adr.indexOf("@");
		if(idx < 0) {
			idx = adr.indexOf("at", 1);
			if(idx >= 0 && idx < adr.length() - 2) adr.replace(idx, idx+2, "@");
		}
		//System.out.println(adr);
		while(true) {
			idx = adr.indexOf("dot", 1);
			if(idx >= 0 && idx < adr.length() - 3) adr.replace(idx, idx+3, ".");
			else break;
		}
		System.out.println(adr);
	}
	int Bsolve(int v, int sell, ArrayList<Integer> buys)
	{
		int ans = 0;
		if(buys.isEmpty()) return v;
		for(Integer buy :buys) {
			if(buy > v) break;
			int rem = v % buy;
			ans += (v / buy * sell);
			//System.err.println("LOOP " + ans + " " + v + " " + buy);
			v = rem;
		}
		ans += v;
		return ans;
	}
	void B() {
		int n = sc.nextInt(), b = sc.nextInt();
		int ans = b;
		int[] a = new int[n];
		for(int i = 0; i < n; i++) a[i] = sc.nextInt();
		ArrayList<Integer> buys = new ArrayList<Integer>();
		for(int sell = 0; sell < n; sell++) {
			int cand = Bsolve(b, a[sell], buys);
			//System.err.println("" + b + " " + sell + " " + a[sell] + " "  + cand + " " + buys);
			if(cand > ans ) ans = cand;
			buys.add(a[sell]);
			Collections.sort(buys);
		}
		System.out.println(ans);
	}
	void A() {
		String a, b, c;
		a = sc.next(); b = sc.next();
		c = new StringBuilder(a).reverse().toString();
		//System.err.println(a);
		//System.err.println(b);
		//System.err.println(c);
		if(b.equals(c)) System.out.println("YES");
		else System.out.println("NO");

	}

}


import java.util.Arrays;import java.util.Scanner;
public class sherif {
    public static void main (String args[]){
        Scanner sherif = new Scanner(System.in) ;
        long a[] = new long [3] ;
        a[0] = sherif.nextLong() ;
        a[1] = sherif.nextLong();
        a[2] = sherif.nextLong() ;
        Arrays.sort(a);
        long h = min((a[0]+a[1]+a[2])/3,(a[0]+a[1]));
        System.out.print(h);
    }

    private static long min(long a, long c) {
        if(a<c)return a ;
        return c;
    }

    private static long pow(int i, long count) {
        // TODO Auto-generated method stub
        return 0;
    }
}


import java.util.*;

public class test {

public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    int N = Integer.parseInt(in.next());
    int K = Integer.parseInt(in.next());
    int min = Integer.MAX_VALUE;
    for (int i = 0; i < N; i++) {
        int a = Integer.parseInt(in.next());
        if (K % a == 0 && min > K/a) min = K/a;
    }
    System.out.println(min);
}
}


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

public class Div2_418E {

	// solution completely based on that of the editorial

	static final long MOD = 1_000_000_007L;

	static int numV;

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

		numV = Integer.parseInt(reader.readLine());

		int[] deg = new int[numV + 1];
		StringTokenizer inputData = new StringTokenizer(reader.readLine());
		for (int i = 1; i <= numV; i++) {
			deg[i] = Integer.parseInt(inputData.nextToken());
		}
		reader.close();

		// let assign[A][B][C] represent the number of ways to move to a level with A vertices from a level with B
		// 1-opening vertices and C 2-opening vertices
		long[][][] aCnt = new long[numV + 5][numV + 5][numV + 5];

		aCnt[0][0][0] = 1;

		// loop ordering is non-trivial cnt2 has to be before the cnt1 loop
		for (int cntE = 0; cntE <= numV; cntE++) {
			for (int cnt2 = 0; cnt2 <= numV; cnt2++) {
				for (int cnt1 = 0; cnt1 <= numV; cnt1++) {
					long cCnt = 0;

					// ext, ext
					// ext, t1
					// ext, t2
					// t1, t1
					// t1, t2
					// t2, t2

					if (cnt2 > 0) {
						if (cntE > 1) {
							cCnt += aCnt[cntE - 2][cnt1][cnt2 - 1] * cntE * (cntE - 1) >> 1;
						}
						if (cntE > 0 && cnt1 > 0) {
							cCnt += aCnt[cntE - 1][cnt1 - 1][cnt2 - 1] * cntE * cnt1;
						}
						if (cntE > 0 && cnt2 > 1) {
							cCnt += aCnt[cntE - 1][cnt1 + 1][cnt2 - 2] * cntE * (cnt2 - 1);
						}
						if (cnt1 > 1) {
							cCnt += aCnt[cntE][cnt1 - 2][cnt2 - 1] * cnt1 * (cnt1 - 1) >> 1;
						}
						if (cnt1 > 0 && cnt2 > 1) {
							cCnt += aCnt[cntE][cnt1][cnt2 - 2] * cnt1 * (cnt2 - 1);
						}
						if (cnt2 > 2) {
							cCnt += aCnt[cntE][cnt1 + 2][cnt2 - 3] * (cnt2 - 1) * (cnt2 - 2) >> 1;
						}
						cCnt %= MOD;
						aCnt[cntE][cnt1][cnt2] = cCnt;
					} else if (cnt1 > 0) {
						if (cntE > 0) {
							cCnt += aCnt[cntE - 1][cnt1 - 1][0] * cntE;
						}
						if (cnt1 > 1) {
							cCnt += aCnt[cntE][cnt1 - 2][0] * (cnt1 - 1);
						}
						cCnt %= MOD;
						aCnt[cntE][cnt1][cnt2] = cCnt;
					}
				}
			}
		}

		int[] preCnt1 = new int[numV + 1];
		for (int i = 1; i <= numV; i++) {
			preCnt1[i] = deg[i] == 2 ? 1 + preCnt1[i - 1] : preCnt1[i - 1];
		}

		long[][] ans = new long[numV + 5][numV + 5];

		// smart way of initializing everything with the last object to 1
		ans[numV + 1][numV] = 1;

		for (int l = numV; l > 1; l--) {
			for (int r = l; r <= numV; r++) {
				int cnt1 = preCnt1[r] - preCnt1[l - 1];
				int cnt2 = r - l + 1 - cnt1;

				for (int nLevLen = 0; nLevLen <= (cnt2 << 1) + cnt1 && r + nLevLen <= numV; nLevLen++) {
					ans[l][r] = (ans[l][r] + ans[r + 1][r + nLevLen] * aCnt[nLevLen][cnt1][cnt2]) % MOD;
				}
			}
		}

		System.out.println(ans[2][1 + deg[1]]);
	}

}


import java.util.*;
public class program
{
	public static void main(String args[])
	{
		Scanner sc=new Scanner(System.in);
	   int n=sc.nextInt();
	   int m=sc.nextInt();
	   int a[]=new int[m];
	    int x[]=new int[101];
	   for(int i=0;i<m;i++)
	  {  a[i]=sc.nextInt();
	     x[a[i]]++;
	  }
       int l = 0;
		int r = 101;
		while(r - l > 1) {
			int mm = l + r >>> 1;
			int k = 0;
			for (int i = 0; i <= 100; i++) {
				k += x[i] / mm;
			}
			if (k >= n) {
				l = mm;
			} else {
				r = mm;
			}
		}
		System.out.println(l);
	}
}


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

public final class Main {

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

        StringTokenizer st = new StringTokenizer(br.readLine());
        int n = Integer.parseInt(st.nextToken());

        st = new StringTokenizer(br.readLine());

        int[] months = new int[]{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
        int[] compare = new int[n];
        int index = 0;
        int leapCount = 0;
        while(n-->0){
            int a = Integer.parseInt(st.nextToken());
            compare[index++] = a == 29 ? 28 : a;
            leapCount += a == 29 ? 1 : 0;
        }

        if(leapCount > 1){
            System.out.println("No");
            return;
        }

        for(int i = 0; i<12; i++){
            if(months[i] != compare[0])
                continue;
            int currMonthIndex = i;
            boolean found = true;
            for(int j = 0; j<compare.length; j++){
                int val = compare[j];
                if(val != months[currMonthIndex])
                    found = false;
                currMonthIndex++;
                currMonthIndex%=months.length;
            }
            if(found){
                System.out.println("Yes");
                return;
            }
        }

        System.out.println("No");

    }
}


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

public class Solution implements Runnable{
    public static BufferedReader br;
    public static PrintWriter out;
    public static StringTokenizer stk;
    public static boolean isStream = true;

    public static void main(String[] args) throws IOException {
    	if (isStream) {
            br = new BufferedReader(new InputStreamReader(System.in));
        } else {
            br = new BufferedReader(new FileReader("in.txt"));
        }
        out = new PrintWriter(System.out);
        new Thread(new Solution()).start();
    }

    public void loadLine() {
        try {
            stk = new StringTokenizer(br.readLine());
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

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

    public String nextWord() {
        while (stk==null||!stk.hasMoreTokens()) loadLine();
        return stk.nextToken();
    }

    public Integer nextInt() {
        while (stk==null||!stk.hasMoreTokens()) loadLine();
        return Integer.valueOf(stk.nextToken());
    }

    public Long nextLong() {
        while (stk==null||!stk.hasMoreTokens()) loadLine();
        return Long.valueOf(stk.nextToken());
    }

    public Double nextDouble() {
        while (stk==null||!stk.hasMoreTokens()) loadLine();
        return Double.valueOf(stk.nextToken());
    }

    public Float nextFloat() {
        while (stk==null||!stk.hasMoreTokens()) loadLine();
        return Float.valueOf(stk.nextToken());
    }

    public void run() {
    	int a = nextInt();
    	int b = nextInt();
    	int mod = nextInt();
    	int bnd = Math.min(a, mod);
    	int ans = -1;
    	for (int i = 0; i <= bnd; i++) {
    		long aa = i*1000000000L%mod;
    		int rem = (int)aa;
    		if (rem != 0 && mod-rem > b) {
    			ans = i;
    			break;
    		}
    	}
    	if (ans >= 0) {
    		StringBuilder sb = new StringBuilder();
    		for (int i = 0; i < 9; i++) {
    			sb.append(ans%10);
    			ans/=10;
    		}
    		out.println(1+" "+sb.reverse().toString());
    	} else {
    		out.println(2);
    	}
    	out.flush();
    }
}


import java.util.Scanner;

public class RoutineProblem {

	/**
	 * @param args
	 */

	public static int GCD(int a, int b) {
		   if (b==0) return a;
		   return GCD(b,a%b);
	}

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();
		if(a*d == b*c) {
			System.out.println("0/1");
		} else if(a*d > b*c) {
			int g = GCD(a*d-b*c,a*d);
			System.out.println((a*d-b*c)/g + "/" + a*d/g);
		} else {
			int g = GCD(b*c-a*d,b*c);
			System.out.println((b*c-a*d)/g + "/" + b*c/g);
		}

	}

}


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

import static java.lang.Math.*;

public class Main {
    public static void main(String[] args) {
        FastScanner sc = new FastScanner(System.in);
        PrintWriter pw = new PrintWriter(System.out);
        int n = sc.nextInt();
        int[] r = new int[n];
        int[]b  = new int[n];
        int cntB = 0;
        int cntR = 0;
        for (int i = 0; i < n; i++)
            r[i] = sc.  nextInt();
        for (int i = 0; i < n; i++)
            b[i] = sc.nextInt();
        for (int i = 0; i < n; i++) {
            if(r[i] + b[i] == 2)
                continue;
            if(r[i] == 1)
                cntR++;
            if(b[i] == 1)
                cntB++;
        }
        if (cntR == 0)
            pw.print("-1");
        else
            pw.print((cntB) / cntR + 1);
        pw.close();
    }

    public static boolean isVowel(char a) {
        return a == 'a' || a == 'e' || a == 'u' || a == 'o' || a == 'y';
    }

    public static long binPow(long a, int n) {
        long p = a;
        long res = 1;
        while (n > 0) {
            if (n % 2 == 1)
                res *= p;
            p *= p;
            n /= 2;
        }
        return res;
    }

    public static int gcd(int a, int b) {
        if (a == 0 || b == 0)
            return a + b;
        return gcd(b % a, a);
    }

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

class FastScanner {
    static BufferedReader br;
    static StringTokenizer st = new StringTokenizer("");

    public FastScanner(InputStream inputStream) {
        br = new BufferedReader(new InputStreamReader(inputStream));
    }

    public FastScanner(String fileName) throws FileNotFoundException {
        br = new BufferedReader(new FileReader(fileName));
    }

    public boolean hasNext() {
        try {
            while (!st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return true;
        } catch (Exception e) {
            return false;
        }
    }

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

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

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

    public String next() {
        hasNext();
        return st.nextToken();
    }
}


import java.util.*;
public class JavaApplication7 {
 public static void main(String[] args) {
  Scanner obj = new Scanner(System.in);
  long [] arr = new long [3];
  for(int i=0 ; i<3; i ++)  arr[i]=obj.nextLong();
  if(arr[2]<=arr[1])
      System.out.println(arr[2]);
  else if (arr[2]<=(arr[0]))
      System.out.println(arr[1]);
  else{
      long n=arr[2]-arr[0];
      System.out.println(Math.abs(n-arr[1]));
  }
 }}


import java.util.Scanner;
public class Taymyriscallingyou{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int z = sc.nextInt();
		int counter = 0;

		for(int i = n; i <= z; i = i + n){
			for(int j = m; j <= i; j = j+m){
				if(i == j) counter++;
			}
		}
		System.out.println(counter);
	}
}


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

public class StringPlay {
    public static final int UNREACHABLE = 1000;

    FastScanner in;
    PrintWriter out;

    public void solve() throws IOException {
        int n = in.nextInt();
        char[][] t = new char[n][n];
        for (int i = 0; i < n; i++) {
            t[i] = in.next().toCharArray();
        }

        int[] curr = new int[1 << n];
        Arrays.fill(curr, UNREACHABLE);
        curr[1 << (n - 1)] = 0;

        int[] next = new int[1 << n];
        Arrays.fill(next, UNREACHABLE);
        int[] nextMask = new int['z' - 'a' + 1];
        int[] charMasks = new int['z' - 'a' + 1];

        for (int layer = 2 * n - 2; layer > 0; layer--) {
            boolean first = layer % 2 == 0;

            Arrays.fill(charMasks, 0);
            for (int row = 0; row < n; row++) {
                int col = layer - row - 1;
                if (col >= 0 && col < n) {
                    int ch = t[row][col] - 'a';
                    charMasks[ch] += (1 << row);
                }
            }

            for (int charMask : charMasks) {
                for (int state = charMask; state > 0; state = (state - 1) & charMask) {
                    Arrays.fill(nextMask, 0);
                    char sel = 0;
                    for (int row = 0; row < n; row++) {
                        int bit = 1 << row;
                        if ((state & bit) == 0) {
                            continue;
                        }

                        int col = layer - row - 1;
                        if (col < 0 || col > n - 1) {
                            sel = 0;
                            break;
                        }

                        if (sel == 0) {
                            sel = t[row][col];
                        }
                        if (sel != t[row][col]) {
                            sel = 0;
                            break;
                        }

                        if (col < n - 1) {
                            int ch = t[row][col + 1] - 'a';
                            nextMask[ch] |= (1 << (row));
                        }
                        if (row < n - 1) {
                            int ch = t[row + 1][col] - 'a';
                            nextMask[ch] |= (1 << (row + 1));
                        }
                    }

                    if (sel == 0) {
                        continue;
                    }

                    int nonrelaxed = UNREACHABLE;
                    for (int i = 0; i < nextMask.length; i++) {
                        int mask = nextMask[i];
                        if (mask == 0) {
                            continue;
                        }

                        int add = getValue((char) ('a' + i));
                        int from = curr[mask];
                        if (from == UNREACHABLE) {
                            continue;
                        }

                        if (nonrelaxed == UNREACHABLE) {
                            nonrelaxed = from + add;
                        } else if (first) {
                            nonrelaxed = Math.max(nonrelaxed, from + add);
                        } else {
                            nonrelaxed = Math.min(nonrelaxed, from + add);
                        }
                    }
                    next[state] = nonrelaxed;
                }
            }

            int[] tmp = next;
            next = curr;
            curr = tmp;
        }

        int res = curr[1] + getValue(t[0][0]);
        if (res == 0) {
            out.println("DRAW");
        } else {
            out.println(res > 0 ? "FIRST" : "SECOND");
        }
    }

    private int getValue(char c) {
        return c != 'a' ? c == 'b' ? -1 : 0 : 1;
    }

    public void run() {
        try {
            in = new FastScanner(System.in);
            out = new PrintWriter(System.out);

            solve();

            out.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        FastScanner(InputStream is) {
            br = new BufferedReader(new InputStreamReader(is));
        }

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

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

    public static void main(String[] arg) {
        new StringPlay().run();
    }
}


import java.util.HashSet;
import java.util.Scanner;

public class Chatroom {
	public static Scanner scan;
	static String word, tobe;

	static HashSet<Character> hashi = new HashSet<Character>();

	public static void main(String[] args) {
		scan = new Scanner(System.in);
		word = scan.nextLine();
		tobe = "";
		if (isthere('h') && isthere('e') && isthere('l') && isthere('l') && isthere('o')) {
			System.out.println("YES");

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

		}

	}

	private static boolean isthere(char dude) {
		// TODO Auto-generated method stub
		for (int i = 0; i < word.length(); i++) {
			if (word.charAt(i) == dude) {
				word = word.substring(i + 1, word.length());
				return true;
			}
		}
		return false;
	}

}


import java.util.*;

public class Codeforces{
public static void main(String args[]){
	Scanner sc = new Scanner(System.in);
	int l = sc.nextInt();
	int r = sc.nextInt();
	int a = sc.nextInt();
	int minval = Math.min(l,r);
	int maxval = Math.max(l, r);
	while(minval < maxval && a>0){
		minval ++ ;
	//	System.out.println("sldfjsd");
		a--;
	}
	while((minval == maxval) && a>1){
		minval++;
		//System.out.println("minval"+minval);
		//System.out.println("a"+a);
		maxval++;
		//System.out.println("maxval"+maxval);
		a = a - 2;

	}
	System.out.println(minval*2);

}

}


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

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

class PreparingOlympiad {
    public void solve(int testNumber, InputReader in, PrintWriter out) {
        int n = in.nextInt();
        int l = in.nextInt();
        int r = in.nextInt();
        int x = in.nextInt();
        int[] c = new int[n];
        for (int i = 0; i < n; i++) c[i] = in.nextInt();
        Arrays.sort(c);
        int res = 0;
        for (int i = 1; i < (1 << n); i++) {
            int hi = Integer.highestOneBit(i);
            int lo = Integer.lowestOneBit(i);
            hi = (int)(Math.log(hi) / Math.log(2));
            lo = (int)(Math.log(lo) / Math.log(2));
            if (c[hi] - c[lo] < x) continue;
            int sum = 0;
            for (int j = 0; j < n; j++)
                if ((i & (1 << j)) != 0) sum += c[j];
            if (sum <= r && sum >= l) res ++;
        }
        out.println(res);
    }
}

class InputReader {
    public BufferedReader reader;
    public StringTokenizer tokenizer;

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

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

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

}


import java.util.Scanner;

/**
 * Hello world!
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int start = 0;
        int score = 0;
        for (int i = 0; i < s.length(); i++) {
            int charIndex = s.charAt(i) - 97;
            int walk = Math.abs(start - charIndex);

            if(walk < 13){
                score += walk;
            }else{
                score += 26 - walk;
            }
            start = charIndex;
        }
        System.out.println(score);
    }
}


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

import java.awt.Point;
import java.io.*;
import java.math.BigInteger;
import java.util.*;
import java.text.*;

/**
 *
 * @author zulkan
 */
public class bearAndCompressing {

    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    static PrintWriter out = new PrintWriter(System.out);
    static Scanner sc = new Scanner(System.in);

    public static String getString() {
        try {
            return br.readLine();
        } catch (Exception e) {
        }
        return "";
    }

    public static Integer getInt() {
        try {
            return Integer.parseInt(br.readLine());
        } catch (Exception e) {
        }
        return 0;
    }

    public static Integer[] getIntArr() {
        try {
            StringTokenizer temp = new StringTokenizer(br.readLine());
            int n = temp.countTokens();
            Integer temp2[] = new Integer[n];
            for (int i = 0; i < n; i++) {
                temp2[i] = Integer.parseInt(temp.nextToken());
            }
            return temp2;
        } catch (Exception e) {
        }
        return null;
    }

    public static Long[] getLongArr() {
        try {
            StringTokenizer temp = new StringTokenizer(br.readLine());
            int n = temp.countTokens();
            Long temp2[] = new Long[n];
            for (int i = 0; i < n; i++) {
                temp2[i] = Long.parseLong(temp.nextToken());
            }
            return temp2;
        } catch (Exception e) {
        }
        return null;
    }

    public static String[] getStringArr() {
        try {
            StringTokenizer temp = new StringTokenizer(br.readLine());
            int n = temp.countTokens();
            String temp2[] = new String[n];
            for (int i = 0; i < n; i++) {
                temp2[i] = (temp.nextToken());
            }
            return temp2;
        } catch (Exception e) {
        }
        return null;
    }

    public static void print(Object a) {
        out.print(a);
    }

    public static void println(Object a) {
        out.println(a);
    }

    public static void printf(String s, Object... a) {
        out.printf(s, a);
    }

    public static int nextInt() {
        return sc.nextInt();
    }

    public static double nextDouble() {
        return sc.nextDouble();
    }

    public static void main(String[] ar) {
        bearAndCompressing c = new bearAndCompressing();
        c.solve();
        out.flush();
    }

    public void solve() {
        Integer xx[] = getIntArr();
        int n = xx[0], k = xx[1];

        Map<String, List<String>> he = new HashMap();
        for (int i = 0; i < k; i++) {
            String x[] = getStringArr();

            if (!he.containsKey(x[1])) {
                he.put(x[1], new ArrayList<String>());
            }
            he.get(x[1]).add(x[0]);

        }
        HashSet<String> sdh = new HashSet<String>();
        LinkedList<String> Q = new LinkedList<>();

        Q.add("a");
        int f = 0;
        while (Q.size() > 0 && Q.peek().length() < n) {
            String p = Q.remove();

            List<String> ne = he.get(p.charAt(0) + "");

            if (ne != null) {
                for (String ss : ne) {
                    String next = ss + p.substring(1);
                    if (!sdh.contains(next)) {
                        //System.out.println("MASUKIN "+next);
                        sdh.add(next);
                        Q.add(next);
                        if(next.length() == n) {
                            f++;
                        }
                    }
                }
            }
        }
       // println(Q);
        println(f);

    }

}


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

public class jdssj {

	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int i;
		for( i=1;i<50;i++) {
			if((1<<i)>n)break;
		}
		System.out.println(i);
	}
	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader( s));
		}

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

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

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

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public double nextDouble() throws IOException {
			String x = next();
			StringBuilder sb = new StringBuilder("0");
			double res = 0, f = 1;
			boolean dec = false, neg = false;
			int start = 0;
			if (x.charAt(0) == '-') {
				neg = true;
				start++;
			}
			for (int i = start; i < x.length(); i++)
				if (x.charAt(i) == '.') {
					res = Long.parseLong(sb.toString());
					sb = new StringBuilder("0");
					dec = true;
				} else {
					sb.append(x.charAt(i));
					if (dec)
						f *= 10;
				}
			res += Long.parseLong(sb.toString()) / f;
			return res * (neg ? -1 : 1);
		}

		public boolean ready() throws IOException {
			return br.ready();
		}
	}

}


import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class EducationalRound86E {

	public static long mod = 998244353;
	public static int max = (int)4e5+10;
	public static long[] fact;
	public static long[] infact;

	public static void PreCompute() {
		fact = new long[max];
		infact = new long[max];
		fact[0] = fact[1] = infact[0] = infact[1] = 1;
		for(int i = 2; i < max; i++) {
			fact[i] = (fact[i - 1] * (long)i)%mod;
			infact[i] = (infact[i - 1] * (long)ModInverse(i, mod))%mod;
		}
	}

	public static long nCr(int n, int r) {
		long ans = fact[n] * infact[r];
		ans %= mod;
		ans *= infact[n - r];
		ans %= mod;
		return ans;
	}

	public static long fast(long a, long n) {
		if(n == 0) return 1L;
		long ans = fast(a, n/2L);
		ans = ans * ans;
		ans %= mod;
		if(n%2 == 1) {
			ans = ans * a;
			ans %= mod;
		}
		return ans;
	}

	public static void solve() {
		PreCompute();
		int n = s.nextInt();
		long k = s.nextLong();
		if(k == 0) {
			out.println(fact[n]);
			return;
		}
		if(n <= k) {
			out.println(0);
			return;
		}
		long ans = nCr(n, (int)k);
		int cols = n - (int)k;
		long sum = 0;
		for(int i = 0; i <= cols; i ++) {
			long tempans = nCr(cols, i);
			tempans *= fast(cols - i, n);
			tempans %= mod;
			if((i&1)==1) {
				sum -= tempans;
				if(sum < 0) sum += mod;
			}else {
				sum+=tempans;
				if(sum >= mod) sum -= mod;
			}
		}
		out.println((2 * ((ans * sum)%mod))%mod);
	}

	public static void main(String[] args) {
		out = new PrintWriter(new BufferedOutputStream(System.out));
		s = new FastReader();
		solve();
		out.close();
	}

	public static class Triplet {
		long gcd;
		long x;
		long y;

		Triplet(long gcd, long x, long y) {
			this.gcd = gcd;
			this.x = x;
			this.y = y;
		}
	}

	public static Triplet ExtendedEuclideanAlgo(long a, long b) {
		if (a == 0) {
			return new Triplet(b, 0, 1);
		}
		Triplet ans = ExtendedEuclideanAlgo(b % a, a);
		long x = ans.y - (b / a) * ans.x;
		long y = ans.x;
		return new Triplet(ans.gcd, x, y);
	}

	public static long ModInverse(long a, long m) {
		Triplet ans = ExtendedEuclideanAlgo(a, m);
		if (ans.gcd != 1) {
			//System.out.println("Multiplicative inverse doesnot exist");
			return -1;
		} else {
			//m is added to handle negative x
			long result = (ans.x % m + m) % m;
			return result;
		}
	}

	public static FastReader s;
	public static PrintWriter out;

	public static class FastReader {
		BufferedReader br;
		StringTokenizer st;

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

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

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

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

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

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

}


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

/*
procrastinating
*/

public class Main {

    static FastReader in;
    static PrintWriter out;
    static Random rand = new Random();
    static final int INF = (int) (1e9 + 10);
    static final int MOD = 998244353;
    static final int N = (int) (2e5 + 10);

    static long[] f, f1;

    static long pow(long a, long b) {
        long res = 1;
        while (b != 0) {
            if ((b & 1) == 1)
                res = (res * a) % MOD;
            a = (a * a) % MOD;
            b >>= 1;
        }
        return res;
    }

    static long C(int n, int k) {
        return f[n] * f1[k] % MOD * f1[n - k] % MOD;
    }

    static void precalc() {
        f = new long[N];
        f[0] = 1;
        for (int i = 1; i < N; i++)
            f[i] = (f[i - 1] * i) % MOD;

        f1 = new long[N];
        for (int i = 0; i < N; i++)
            f1[i] = pow(f[i], MOD - 2);
    }

    static void solve() {
        precalc();

        int n = in.nextInt();
        long k = in.nextLong();

        if (k > n - 1) {
            out.println(0);
            return;
        }
        if (k == 0) {
            out.println(f[n]);
            return;
        }

        int m = n - (int) k;

        long res = 0;
        for (int i = 0; i <= m - 1; i++) {
            long sign = i % 2 == 0 ? 1L : -1L;
            res += sign * C(m, i) * pow(m - i, n) % MOD;
            res %= MOD;
        }
        if (res < 0)
            res += MOD;

        long ans = 2L * res * C(n, m) % MOD;
        out.println(ans);
    }

    public static void main(String[] args) throws FileNotFoundException, InterruptedException {
        in = new FastReader(System.in);
//        in = new FastReader(new FileInputStream("sometext.txt"));
        out = new PrintWriter(System.out);
//        out = new PrintWriter(new FileOutputStream("output.txt"));

        Thread thread = new Thread(null, () -> {
            int tests = 1;
//            tests = in.nextInt();

            while (tests-- > 0) {
                solve();
            }
        }, "Go", 1 << 28);
        thread.start();
        thread.join();

//        out.flush();
        out.close();
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        FastReader(InputStream is) {
            br = new BufferedReader(new InputStreamReader(is));
        }

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

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

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

        String next() {
            while (st == null || !st.hasMoreTokens()) {
                st = new StringTokenizer(nextLine());
            }
            return st.nextToken();
        }

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


/*
 ID: tommatt1
 LANG: JAVA
 TASK:
*/
import java.util.*;
import java.io.*;
public class cf1342e{
static int mod=998244353;

	public static void main(String[] args)throws IOException {
		PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
		BufferedReader bf=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer(bf.readLine());
		int n=Integer.parseInt(st.nextToken());
		long k=Long.parseLong(st.nextToken());
		if(k>n) {
			out.println(0);
			out.close();
			System.exit(0);
		}
		int a=n-(int)k;
		long ncr=1;
		long ans=0;
		for(int i=a;i>0;i--) {
			long sgn=(a-i)%2==0?1:-1;
			ans+=sgn*ncr*fexp(i,n);
			ans%=mod;
			ans=(ans+mod)%mod;
			ncr=(ncr*i+mod)%mod;
			ncr=(ncr*fexp(a-i+1,mod-2)+mod)%mod;
		}
		a=Math.max(a, (int)k);
		for(int i=a+1;i<=n;i++) {
			ans=(ans*i+mod)%mod;
		}
		for(int i=1;i<=n-a;i++) {
			ans=(ans*fexp(i,mod-2)+mod)%mod;
		}
		if(k!=0) {
			ans*=2;
			ans%=mod;
		}
		out.println(ans);
		out.close();
	}
	public static long fexp(long a,long e)
	{
		if(e==0) return 1;
		long tmp = fexp(a,e/2);
		tmp = (tmp*((long)tmp))%mod;
		if(e%2==1) tmp = (tmp*((long)a))%mod;
		return tmp;
	}
}


import java.io.*;
import java.text.*;
import java.util.*;
import java.math.*;
public class template {
	public static void main(String[] args) throws Exception {
		new template().run();
	}
	public void run() throws Exception {
		FastScanner f = new FastScanner();
		PrintWriter out = new PrintWriter(System.out);
		int n = f.nextInt(); long k = f.nextLong();
		if(k >= n) out.println(0);
		else {
			long[] fact = new long[n+1];
			long[] inv = new long[n+1];
			fact[0] = 1;
			inv[0] = 1;
			for(int i = 1; i <= n; i++) {
				fact[i] = i*fact[i-1]%MOD;
				inv[i] = inv(fact[i],MOD);
			}
			int r = (int) (n-k);
			long ways = 0;
			for(int i = 1; i <= r; i++) {
				long l = fact[r]*inv[r-i]%MOD*inv[i]%MOD*exp(i,n)%MOD;
				if((r-i) % 2 == 1) l *= -1;
				ways = ((l+ways)%MOD+MOD)%MOD;
			}
			if(k == 0)
				out.println(ways*fact[n]%MOD*inv[r]%MOD*inv[n-r]%MOD);
			else out.println(2*ways%MOD*fact[n]%MOD*inv[r]%MOD*inv[n-r]%MOD);
		}
		out.flush();
	}
	long x, y,MOD = 998244353;
	public long exp(long a, long e) {
		if(e == 0) return 1;
		if(e == 1) return a;
		long r = exp(a,e>>1);
		r = r*r%MOD;
		if((e&1) == 1) r = r*a%MOD;
		return r;
	}
	public long inv(long a, long b) {
		x = 0; y = 1;
		gcdExt(a,b);
		return (x%b+b)%b;
	}
	public void gcdExt(long a, long b) {
		if(a*b == 0) return;
		gcdExt(b%a, a);
		long nx = y - b/a*x;
		long ny = x;
		x = nx;
		y = ny;
	}
    static class FastScanner {
        public BufferedReader reader;
        public StringTokenizer tokenizer;
        public FastScanner() {
            reader = new BufferedReader(new InputStreamReader(System.in), 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());
        }
        public long nextLong() {
        	return Long.parseLong(next());
        }
        public double nextDouble() {
        	return Double.parseDouble(next());
        }
        public String nextLine() {
        	try {
        		return reader.readLine();
        	} catch(IOException e) {
        		throw new RuntimeException(e);
        	}
        }
    }
}