/**
 * Created by Aminul on 9/4/2017.
 */

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

public class CF841C {
    public static int index;
    public static void main(String[] args)throws Exception {
        InputReader in = new InputReader(System.in);
        PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out));
        int n = in.nextInt();
        P[] p = new P[n+1];
        double x[] = new double[6];

        for(int i = 1; i <= n; i++){
            for(int j = 1; j <= 5; j++){
                x[j] = in.nextDouble();
            }
            p[i] = new P(x);
        }

        ArrayList<Integer> ans = new ArrayList<>();

        for(int i = 1; i <= n; i++){
            boolean bol = true;
            for(int j = 1; j <= n; j++){
                if(j == i)continue;
                for(int k = 1; k <= n; k++){
                    if(k == j || k == i) continue;

                    double a = fixAng( getAngle( p[j].sub(p[i]), p[k].sub(p[i]) ) );
                    if( a < 90){
                        bol = false; break;
                    }

                }
                if(!bol) break;
            }
            if(bol) ans.add(i);
        }

        pw.println(ans.size());
        for(int i : ans){
            pw.println(i);
        }

        pw.close();
    }

    static double getAngle(P a, P b){
        double dot = a.dot(b); //debug(dot);
        double av = a.abs(), bv = b.abs(); //debug(av, bv);
        if(av == 0) av = 1;
        if(bv == 0) bv = 1;

        double ang = Math.acos(dot / (av*bv));

        ang = ang*180/Math.PI;

        if(ang < 0){
            ang += 360;
        }

        return ang;

    }

    static double EPS = 1e-9;

    static class P {
        double x[];
        P(double y[]) {
            x = new double[6];
            for(int i = 1; i <= 5; i++){
                x[i] = y[i];
            }

        }

        P sub( P p){
            P s = new P(new double[]{0,0,0,0,0, 0});
            for(int i = 1; i <= 5; i++){
                s.x[i] = p.x[i] - x[i];
            }
            return s;
        }

        double dot(P p) {
            //return x * p.x + y * p.y;
            double dot = 0;
            for(int i = 1; i <= 5; i++){
                dot += x[i]*p.x[i];
            }
            return dot;
        }

        double abs() {
            return Math.sqrt(abs2());
        }
        double abs2() {
            double a = 0;
            for(int i = 1; i <= 5; i++){
                a += x[i]*x[i];
            }
            return a;
        }

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

    }

    static void debug(Object...obj) {
        System.err.println(Arrays.deepToString(obj));
    }

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

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

        //InputReader in = new InputReader(new FileReader("File_Name"));
        public InputReader(FileReader file) {
            reader = new BufferedReader(file);
            tokenizer = null;
        }

        public String next() {

            try {
                while (tokenizer == null || !tokenizer.hasMoreTokens())
                    tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                return null;
            }

            return tokenizer.nextToken();
        }

        public String nextLine() {
            String line = null;
            try {
                tokenizer = null;
                line =  reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
            return line;
        }

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

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

        public long nextLong() {
            return Long.parseLong(next());
        }
        public boolean hasNext(){
            try {
                while (tokenizer == null || !tokenizer.hasMoreTokens())
                    tokenizer = new StringTokenizer(reader.readLine());
            }
            catch (Exception e) {
                return false;
            }

            return true;

        }
    }
}


import java.util.Scanner;

public class Main
{
        public static int hcf(int a , int b)
        {
            int i,temp=0;
            for(i = 1; i <= a || i <= b; i++)
                if( a%i == 0 && b%i == 0 )
                    temp = i;
            return temp;
        }

	    public static void main(String[] args) {
	    Scanner sc = new Scanner(System.in);
        int t = sc.nextInt();
        int sol = 0;
        while(t!=0)
        {
            sol = 0;
            int k = sc.nextInt();
            if(k==100)
            {
                sol=1;

            }
            else
            {
                sol=hcf(k,100-k);
                if(sol==1)
                    sol=k+(100-k);
                else
                    sol=(k/sol)+((100-k)/sol);
            }
        System.out.println(sol);
        }
    }

}(i = 1; i <= a || i <= b; i++) {
         if( a%i == 0 && b%i == 0 )
            hcf = i;
        return hcf;
    }

    public static void main(String args[])
    {
        Scanner sc = new Scanner(System.in);
        int t = sc.nextInt();
        int sol = 0;
        while(t!=0)
        {
            sol = 0;
            int k = sc.nextInt();
            if(k==100)
                sol=1;
            else
            {
                sol=hcf(k,100-k);
                if(sol==1)
                    sol=k+(100-k);
                else
                    sol=(k/sol)+((100-k)/sol);
            }
            System.out.println(sol);
        }
    }
}


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

public class Solution{
    public static class pair{
        int x;
        int y;
    }
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        // int n=Integer.parseInt(br.readLine());
        String line=br.readLine();
        String[] strs=line.trim().split(" ");
        int a=Integer.parseInt(strs[0]);
        int b=Integer.parseInt(strs[1]);
        int c=Integer.parseInt(strs[2]);
        ArrayList<Integer> list=new ArrayList<>();
        for(int i=1;i<=81;i++){
            long val=(b*(long)Math.pow(i,a))+c;
            if(val>=(long)Math.pow(10,9))){
                continue;
            }
            String s=String.valueOf(val);
            int sum=0;
            for(int j=0;j<s.length();j++){
                int v=(int)(s.charAt(j)-48);
                sum+=v;
            }
            if(sum==i&&val>0){
                list.add((int)val);
            }
        }
        System.out.println(list.size());
        for(int i=0;i<list.size();i++){
            System.out.print(list.get(i)+" ");
        }
        System.out.println();
    }
    public static int lcm(int a,int b){
        int x=Math.max(a,b);
        int y=Math.min(a,b);
        long ans=x;
        while(ans%y!=0){
            ans+=x;
        }
        if(ans>Integer.MAX_VALUE){
            return -1;
        }
        return (int)ans;
    }
    public static long fact(int n){
        long ans=1;
        for(int i=1;i<=n;i++){
            ans*=i;
        }
        return ans;
    }
}


package 1230A;

public class 1230A{

	public static void main(String[] args) {

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

}


import java.util.Scanner;
public class BookReadingNaiv{
    int c;
    int v0;
    int v1;
    int  a;
    int l;
    BookReadingNaiv(){
        Scanner sc=new Scanner(System.in);
        c=sc.nextInt();
        v0=sc.nextInt();
        v1=sc.nextInt();
        a=sc.nextInt();
        l=sc.nextInt();
    }
    int calculateNumberOfDays(){
        int days=1;
        int remaining_pages=c-v0;
        int i=1;
        while(remaining_pages>0 && (v0+i*a)<=v1){
            remaining_pages=(remaining_pages-(v0+i*a-l));
            i++;
            days++;
        }
        days=(remaining_pages/(v1-l));
        if(remaining_pages%(v1-l)!=0){
            days++;
        }
        return days;
    }
    public static void main(String[] args) {
        System.out.print((new BookReading()).calculateNumberOfDays());
    }

}


public class NewMain12 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int a = s.nextInt();
        int b = s.nextInt();

        int add = Math.abs(b);
        if (b > 0) {
            System.out.println((a + b) % n);
        } else if(b==0) {
            System.out.println(a);
        } else {
            System.out.println((a + (n - (add % n))) % n);
        }
    }

}


import java.util.*;
import java.io.*;
public class Solution
{
    public static void main(String args[])
    {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        int n=integer.parseInt(br.readLine());
        if((n%2)==0)
        System.out.println("Mahmoud");
        else
        System.out.println("Ehab")

    }
}


import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        while(sc.hasnext()){
            int[] num=new int[5];
            String[] s=sc.nextLine().split(" ");
            for(int i=0;i<5;i++) num[i]=Integer.parseInt(s[i]);
            int min=num[0];
            min=Math.min(min,num[1]);
            min=Math.min(min,num[2]/2);
            min=Math.min(min,num[3]/7);
            min=Math.min(min,num[4]/4);
            System.out.println(min);
        }
    }
}


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

public class Check2
{
	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);
		}
	}

	static void add(HashMap<StringBuilder,Long> map,StringBuilder elem)
	{
		if(!map.containsKey(elem))
			map.put(elem,1L);
		else
			map.put(elem,map.get(elem)+1);
	}

	static class Node implements Comparable<Node>
	{
		int i;
		String key;
		int freq;

		Node(int i,String key,int freq)
		{
			this.i=i;
			this.key=key;
			this.freq=freq;
		}

		public int compareTo(Node node)
		{
			if(freq==node.freq)
				return Integer.compare(i,node.i);

			return Integer.compare(freq,node.freq);
		}
	}

	public static void main(String args[]) throws Exception
	{
		InputReader sc=new InputReader(System.in);
		PrintWriter w=new PrintWriter(System.out);

		int n=(int)(1e6+3);

		int ip[]=new int[n];

		for(int i=2;i<(int)Math.sqrt(n);i++)
		{
			if(ip[i]==0)
			{
				for(int j=i*i;j<n;j=j+i)
				{
					ip[j]++;
				}
			}
		}

		ip[1]++;
		ip[0]++;
		int t=sc.nextInt();
		for(int i=1;i<1001;i++)
		{
			if(ip[t*i+1]==0)
			{
				w.println(i);
				break;3
			}
		}
		w.close();

	}
}


import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Queue;
import java.util.Set;
import java.util.StringTokenizer;
import java.util.TreeSet;

public class solve {

	public static void main(String[] args) {
		MyScanner sc = new MyScanner();
		out = new PrintWriter(new BufferedOutputStream(System.out));
		int n = sc.nextInt();
		Queue<String> q = new LinkedList<String>();
		q.add(sc.next());
		Set<String> ans = new TreeSet<String>();
		while (!q.isEmpty()) {
			Set<String> tset = new HashSet<String>();
			while (!q.isEmpty()) {
				StringBuilder b = new StringBuilder(q.remove());
				if (b.length() == 1)
					ans.add(b.toString());
				else
					for (int i = 0; i < b.length(); i++) {
						for (int j = i + 1; j < b.length(); j++) {
							char ci = b.charAt(i);
							char cj = b.charAt(j);
							char c = move(ci, cj);
							StringBuilder t = new StringBuilder(b.toString());
							tset.add(t.replace(i, i + 1, c + "")
									.replace(j, j + 1, "").toString());
						}
					}
			}
			q.addAll(tset);
		}

		String o = "";
		for (String t : ans)
			o += t;
		out.println(o);
		out.close();
	}

	static String sort(String s) {
		List<Character> v = new ArrayList<Character>();
		for (char c : s.toCharArray())
			v.add(c);
		s = "";
		Collections.sort(v);
		for (char c : v)
			s += c;
		return s;
	}
	static char move(char a, char b) {

		if (a == b)
			return a;

		if (a == 'R' && b == 'G')
			return 'B';
		if (a == 'R' && b == 'B')
			return 'G';

		if (a == 'G' && b == 'R')
			return 'B';
		if (a == 'G' && b == 'B')
			return 'R';

		if (a == 'B' && b == 'R')
			return 'G';
		if (a == 'B' && b == 'G')
			return 'R';
		return a;
	}

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

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

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

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

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

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

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

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

}


//package bear_and_electrons;

import java.util.Collections;
import java.util.LinkedList;
import java.util.Scanner;

public class Bear_and_Elections {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		if (n < 2) {
			System.out.println("-1");
			System.exit(0);
		}
		int votes[] = new int[n - 1];
		int votesLimak = scan.nextInt();
		int bribes = 0;

		LinkedList<Integer> betterCandidats = new LinkedList<Integer>();
		for (int i = 0; i < n - 1; i++) {
			votes[i] = scan.nextInt();
			// Steal from the best only Strategy
			if ((votesLimak + bribes) < votes[i]) {
				int diff = votes[i] - (votesLimak + bribes);
				bribes += diff / 2 + 1;
			}
			if (votesLimak < votes[i]) {
				betterCandidats.add(votes[i]);
			}
		}
		if (bribes == 0) {
			System.out.println(bribes);
			System.exit(0);
		}
		Collections.sort(betterCandidats, new ReverseIntegerIterator());
		if (betterCandidats.size() < 2
				|| !(betterCandidats.getFirst().equals(betterCandidats.get(1)))) {
			System.out.println(bribes);
			System.exit(0);
		}

		int equalCandidats = 1;
		while (equalCandidats < betterCandidats.size()
				&& betterCandidats.get(equalCandidats - 1).equals(
						betterCandidats.get(equalCandidats))) {
			equalCandidats++;
		}

		int newBribes = 0;
		int stolenVotesPerPerson = 0;
		while (votesLimak + newBribes <= betterCandidats.getFirst()
				- stolenVotesPerPerson) {
			stolenVotesPerPerson += 1;
			newBribes += equalCandidats;
		}

		if (newBribes < bribes) {
			if (equalCandidats == betterCandidats.size()) { // no more better candidates except the first group
				System.out.println(newBribes);
				System.exit(0);
			} else {
				if (votesLimak + newBribes > betterCandidats.get(equalCandidats)) {
					System.out.println(newBribes);
					System.exit(0);
			   } else {
				   newBribes += (betterCandidats.get(equalCandidats) - (votesLimak + newBribes)) / 2 + 1;
				   int countedCandidats = equalCandidats + 1;
				   if (newBribes < bribes) {
					   if (countedCandidats == betterCandidats.size()) { // no more better candidates except these
							System.out.println(newBribes);
							System.exit(0);
						}
					   if (votesLimak + newBribes > betterCandidats.get(equalCandidats)) {
							System.out.println(newBribes);
							System.exit(0);
					   }
				   }
			   }
			}
		}

		System.out.println(bribes);
		System.exit(0);
	}

}


import java.util.*;
public class LiveDonNotNull
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
String a1="";
for(int i=0;i<String.valueOf(a).length();i++)
{
    String d = String.valueOf(a);
    if(d.charAt(i) != '0')
    {
        a1 += d.substring(i,i + 1);
    }
}
int b = sc.nextInt();
String b1="";
for(int i=0;i<String.valueOf(b).length();i++)
{
    String d2 = String.valueOf(b);
    if(d2.charAt(i) != '0')
    {
        b1 += d2.substring(i,i + 1);
    }
}
int c = a + b;
String c1 = "";
for(int i=0;i<String.valueOf(c).length();i++)
{
    String d3 = String.valueOf(c);
    if(d3.charAt(i) != '0')
    {
        c1 += d3.substring(i,i + +);
    }
}
if(Integer.parseInt(c1) == Integer.parseInt(a1) + Integer.parseInt(b1))
{
    System.out.println("YES");
}
else
{
    System.out.println("NO");
}
}
}


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

public class Solution{
	public static void main(String args[]) throws Exception{
		scanner sc = new scanner(system.in);
		output out = new output(system.out);

		long a1,a2,b1,b2,c1,c2;
		a1 = sc.nextLong();
		a2 = sc.nextLong();
		b1 = sc.nextLong();
		b2 = sc.nextLong();
		c1 = sc.nextLong();
		c2 = sc.nextLong();
		if ((b1 - a1) * (c2 - a2) == (b2 - a2) * (c1 - a1))
			out.out.println("TOWARDS");
		if ((b1 - a1) * (c2 - a2) > (b2 - a2) * (c1 - a1))
			out.out.println("LEFT");
		if ((b1 - a1) * (c2 - a2) < (b2 - a2) * (c1 - a1))
			out.out.println("RIGHT");
		out.close();
		sc.close();
	}
}

class output{
	public PrintWriter out;
	public File temp;
	public output(OutputStream stream){
		out = new PrintWriter(stream);
	}
	public output(String filename){
		temp = new File(filename);
		try {
			out = new PrintWriter(temp);
		}
		catch(FileNotFoundException e){
			return;
		}
	}
	public void close(){
		out.close();
	}
}

class scanner extends BufferedReader{
	public String now;
	public StringTokenizer st;
	public boolean have_st, eof;
	public scanner(String filename)throws Exception{
		super(new FileReader(filename));
		have_st = false;
	}
	public scanner(InputStream stream){
		super(new InputStreamReader(stream));
		have_st = false;
	}

	String nextToken(){
		if (eof) return null;
		String ret = null;
		for (; ret == null && eof == false; ){
			if (st != null && st.hasMoreTokens()){
				ret = st.nextToken();
				break;
			}
			try{
				now = readLine();
				st = new StringTokenizer(now);
			}
			catch (IOException e){
				eof = true;
			}
		}
		return ret;
	}

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

	public long nextLong(){
		return Long.parseLong(nextToken());
	}
	public double nextDouble(){
		return Double.parseDouble(nextToken());
	}
	public String nextString(){
		return nextToken();
	}

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


public class TripForMeal {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);;
        int n = Integer.parseInt(in.nextLine());
        int a = Integer.parseInt(in.nextLine());
        int b = Integer.parseInt(in.nextLine());
        int c = Integer.parseInt(in.nextLine());
        int current = 0;
        int counter = 0;
        n--;
        while(n>0){
            switch(current){
                case 0:
                    if(a<b){
                        counter += a;
                        n--; current = 1;
                    } else{ counter += b;
                        n--; current = 2;}
                break;
                case 1:
                   if(a<c){
                        counter += a;
                        n--; current = 0;
                    } else{ counter += c;
                        n--; current = 2;}
                break;
                case 2:
                    if(b<c){
                        counter+=b;
                        n--; current = 0;
                    } else{
                        counter += c;
                        n--; current =1;
                    }
                break;
            }
        }
        System.out.println(counter);
    }

}


package com.ilyas;

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

import static java.lang.Integer.max;

public class Main {

    MyScanner cin = new MyScanner(System.in);
    PrintWriter cout = new PrintWriter(System.out);

    private void run() throws FileNotFoundException {
//        MyScanner cin = new MyScanner(System.in);
        try {
            int a = cin.nextInt();
            int b = cin.nextInt();
            int c = cin.nextInt();
            int d = cin.nextInt();
            boolean fl = true;
            for (int i = 0; i <= max(max(a, b), max(c, d)) && fl; i++) {
                if ((a * i + b - d) % c == 0) {
                    System.out.println(max(a * i + b, (a * i + b - d) + d));
                    fl = false;
                }
            }

            if (fl) cout.println(-1);
            cout.close();
        } catch (Exception e) {
            System.out.println(e);
        } catch (Error e) {
            System.out.println(e);
        } catch (RuntimeException e) {
            System.out.println(e);
        }
    }

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

    public class MyScanner {
        BufferedReader br;
        public MyScanner(FileReader in) {
             this.br = new BufferedReader(in);
         }
        public MyScanner(InputStream in) {
             this.br = new BufferedReader(new InputStreamReader(in));
         }

         StringTokenizer st;

         String next() {
             while (st == null || !st.hasMoreElements()) {
                 try {
                     st = new StringTokenizer(br.readLine());
                 } catch (IOException e) {
                     e.printStackTrace();
                 }
             }
             return st.nextToken();
         }
        String tmp = "";
        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 (IOException e) {
                 e.printStackTrace();
             }
             return str;
         }
    }
}


package Codeforces66;

import java.util.Scanner;

public class A {

	/**
	 * @param args
	 */

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int x,y,z, k;
		int q;
		int a,b,c;
		x = in.nextInt();
		y = in.nextInt();
		z = in.nextInt();
		k = in.nextInt();
		if(x>y) {
			q = y;
			y = x;
			x = q;
		}
		if(y>z){
			q = z;
			z = y;
			y = q;
		}
		if(x-1< k/3){
			a = x;
			k = k - x +1;
			if(y-1 < k/2){
				b = y;
				k = k - y + 1;
				if(z-1 < k)
					c = z;
				else
					c = k+1;
			} else{
				b = k/2 +1;
				c = (k+1)/2 +1;
			}
		}else{
			a = k/3 +1;
			b = (k+1)/3 +1;
			c = (k+2)/3 +1;
		}
		System.out.println(a*b*c);
	}

}


public class B {
public static void main(String[] args) {
Scanner reader = new Scanner(System.in);
int z = reader.nextInt();
ArrayList<Integer> a = new ArrayList<Integer>();
for (int i = 0; i < z; i++) {
a.add(reader.nextInt());
}

ArrayList<Integer> b = new ArrayList<Integer>(arrayList);
ArrayList<Integer> q = new ArrayList<Integer>();
ArrayList<Integer> w = new ArrayList<Integer>();

for (int i = 1; i < z-1; i++) {
b.remove(i);
for (int j = 0; j < b.size()-1 ; j++) {
q.add(b.get(j+1) - b.get(j));
}
Collections.sort(q);
w.add(q.get(q.size() - 1));
q = new ArrayList<Integer>();
b = new ArrayList<Integer>(a);
}
Collections.sort(w);

System.out.println(w.get(0));
}
}


// https://codeforces.com/contest/1174/submission/55043857 (rainboy)
import java.io.*;
import java.util.*;

public class CF1174E {
	static final int MD = 1000000007;
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[] aa = new int[n + 1];
		for (int i = 1; i <= n; i++)
			aa[i] = i % 2 == 0 ? aa[i / 2] + 1 : 0;
		int k = 0;
		while (1 << k + 1 <= n)
			k++;
		int[] cnt = new int[k + 1];
		int[] cnt3 = new int[k + 1];
		for (int i = 1; i <= n; i++) {
			int a = aa[i];
			cnt[a]++;
			if (i % 3 == 0)
				cnt3[a]++;
		}
		long[] dp = new long[k + 1];
		long[] dp_ = new long[k + 1];
		dp[k] = 1;
		for (int i = 1; i < n; i++) {
			for (int h = 0; h <= k; h++) {
				long x = dp[h];
				if (x != 0) {
					if (h > 0)
						dp_[h - 1] = (dp_[h - 1] + x * cnt[h - 1]) % MD;
					dp_[h] = (dp_[h] + x * (n / (1 << h) - i)) % MD;
				}
			}
			long[] tmp = dp; dp = dp_; dp_ = tmp;
			Arrays.fill(dp_, 0);
		}
		long ans = dp[0];
		if (3 << k - 1 <= n) {
			Arrays.fill(dp, 0);
			long[] dq = new long[k];
			long[] dq_ = new long[k];
			dq[k - 1] = 1;
			for (int i = 1; i < n; i++) {
				for (int h = 0; h < k; h++) {
					long x = dq[h];
					if (x != 0) {
						if (h > 0)
							dq_[h - 1] = (dq_[h - 1] + x * cnt3[h - 1]) % MD;
						dq_[h] = (dq_[h] + x * (n / (3 << h) - i)) % MD;
						dp_[h] = (dp_[h] + x * (n / (1 << h) - n / (3 << h))) % MD;
					}
					x = dp[h];
					if (x != 0) {
						if (h > 0)
							dp_[h - 1] = (dp_[h - 1] + x * cnt[h - 1]) % MD;
						dp_[h] = (dp_[h] + x * (n / (1 << h) - i)) % MD;
					}
				}
				long[] tmp = dp; dp = dp_; dp_ = tmp; tmp = dq; dq = dq_; dq_ = tmp;
				Arrays.fill(dp_, 0);
				Arrays.fill(dq_, 0);
			}
			ans = (ans + dp[0]) % MD;
		}
		System.out.println(ans);
	}
}


import java.util.HashSet;
import java.util.Set;

/**
 * Created by leen on 6/26/16.
 */
public class _686C extends CodeForceBase {

    public static void main(String[] args) {
        int n = scan.nextInt();
        int m = scan.nextInt();
        int maxHour = n - 1;
        int maxMinutes = m - 1;

        int numHourDigits = 0;
        if(maxHour == 0)
            numHourDigits = 1;
        else {
            while (maxHour > 0) {
                numHourDigits++;
                maxHour /= 7;
            }
        }

        int numMinuteDigits = 0;
        if(maxMinutes == 0)
            numMinuteDigits = 1;
        else {
            while (maxMinutes > 0) {
                numMinuteDigits++;
                maxMinutes /= 7;
            }
        }

       if(numHourDigits + numMinuteDigits > 7) {
           System.out.println(0);
           return;
       }

        int count = 0;
        for(int i = 0; i < n * m; i++) {
            int hours = i / m;
            int minutes = i % m;
            if(!hasDuplicates(hours, minutes, numHourDigits, numMinuteDigits))
                count++;
        }

        System.out.println(count);

    }

    static boolean hasDuplicates(int hours, int minutes, int numHourDigits, int numMinuteDigits) {
        Set<Integer> set = new HashSet<Integer>(16);
        for(int i = 0; i < numHourDigits; i++) {
            int hourDigit = hours % 7;
            if(set.contains(hourDigit))
                return true;
            set.add(hourDigit);
            hours /= 7;
        }

        for(int j = 0; j < numMinuteDigits; j++) {
            int minuteDigit = minutes % 7;
            if(set.contains(minuteDigit))
                return true;
            set.add(minuteDigit);
            minutes /= 7;
        }

        return false;
    }

}


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

		System.out.println(Math.min(3*n+k-1,4*n-k));
	}
}


import java.util.Scanner;

public class FourSegments {

	static Integer x1, x2, y1, y2, x3, x4, y3, y4;
	static boolean valid;

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int[] coordinates = new int[4];
		valid = true;
		// scan the four sides
		for (int i = 0; i < 4 && valid; i++) {
			// scan the two coordinates
			for (int j = 0; j < 4; j++) {
				coordinates[j] = scan.nextInt();
			}
			checkValid(coordinates);
		}
		if (valid && positiveArea()) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	}

	private static void checkValid(int[] coor) {
		// if same x coordinate vertical
		if (coor[0] == coor[2]) {
			if (x3 == null) {
				x3 = coor[0];
			} else {
				x4 = coor[0];
			}
			if (y1 == null && y2 == null) {
				y1 = Math.min(coor[1], coor[3]);
				y2 = Math.max(coor[1], coor[3]);
			} else {
				if (y1 != Math.min(coor[1], coor[3]) || y2 != Math.max(coor[1], coor[3])) {
					valid = false;
				}
			}
		}
		// if same y coordinate horizontal
		else if (coor[1] == coor[3]) {
			if (y3 == null) {
				y3 = coor[1];
			} else {
				y4 = coor[1];
			}
			if (x1 == null && x2 == null) {
				x1 = Math.min(coor[0], coor[2]);
				x2 = Math.max(coor[0], coor[2]);
			} else {
				if (x1 != Math.min(coor[0], coor[2]) || x2 != Math.max(coor[0], coor[2])) {
					valid = false;
				}
			}
		} else {
			valid = false; // not parallel to axis
		}
	}

	private static boolean positiveArea() {
		if (Math.min(x1, x2) == Math.min(x3, x4)) {
			if (Math.max(x1, x2) == Math.max(x3, x4)) {
				if (Math.min(y1, y2) == Math.min(y3, y4)) {
					if (Math.max(y1, y2) == Math.max(y3, y4)) {
						return x4 != x3 && y3 != y4;
					}
				}
			}
		}
		return false;
	}

}


import java.io.IOException;

public class AStudentDream {
	public static void main(String args[]) throws IOException
	{
		Scanner sc = new Scanner(System.in);
		int ar = sc.nextInt();
		int al = sc.nextInt();
		int br = sc.nextInt();
		int bl = sc.nextInt();
		if (bl>=ar-1 && (ar-1)*2>=bl)
			System.out.println("YES");
		else if (br>=al-1 && (al-1)*2>=br)
			System.out.println("YES");
		else
			System.out.println("NO");
	}
}


import java.util.*;
public class Solutions{
    public static void main(String [] args){
        Scanner sc = new Scanner(System.in);
        long a = sc.nextInt();
        long b = sc.nextInt();
        long c = sc.nextInt();
        long d = sc.nextInt();
        long [] arr = new long[1000080];
        for(long i=a ; i<=b ; i++){
            arr[i+b]++;
            arr[i+c+1]--;
        }
        for(long i=1 ; i<=1000080 ; i++){
            arr[i] += arr[i-1];
        }
        for(long i=1000080 ; i<=1 ; i--){
            arr[i-1] += arr[i];
        }
        long ans = 0;
        for(long i=c ; i<=d ; i++){
            ans += arr[i+1];
        }
        System.out.println(ans);

    }
}


import java.util.*;

public class Q3 {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		long n = in.nextInt();
		long a = in.nextInt();
		long b = in.nextInt();
		long p = in.nextInt();
		long q = in.nextInt();

		long c = 0;

		if (p > q) {
			long temp = a;
			a = b;
			b = temp;
			temp = p;
			p = q;
			q = temp;

		}
		c = (n / b) * q;
		if (a != b) {
			if (a < b) {
				if (b % a != 0)
					c += (n / a - (n / (a * b))) * p;
				else
					c += (n / a - (n / a) / (b / a)) * p;
			} else {
				if (a % b != 0)
					c += (n / a - (n / (a * b))) * p;
				else
					c += 0;//(n / a - (n / a) / (a / b)) * p;
			}
		}

		System.out.println(c);

		in.close();
	}
}


import java.util.Scanner;
public class main
{
    public static void main (String[] args)
    {
        Scanner s=new Scanner(System.in);
         int a1=s.nextInt();
         int b1=s.nextInt();
         int a2=s.nextInt();
         int b2=s.nextInt();
         int a3=s.nextInt();
         int b3=s.nextInt();
         int c=0;
         if((a2+a3)<=a1 && c==0)
         {
            if(max(b2,b3)<=b1)
            {
                c=1;
                System.out.println("YES");
            }
         }
         if((a2+b3)<=a1 && c==0)
         {
            if(max(b2,a3)<=b1)
            {
                c=1;
                System.out.println("YES");
            }
        }
        if((b2+a3)<=a1 && c==0)
        {
            if(max(a2,b3)<=b1)
            {
                c=1;
                System.out.println("YES");
            }
         }
        if((b2+b3)<=a1 && c==0)
        {
            if(max(a2,a3)<=b1)
            {
                 c=1;
                System.out.println("YES");
            }
         }
         if((a2+a3)<=b1 && c==0)
         {
            if(max(b2,b3)<=a1)
            {
                c=1;
                System.out.println("YES");
            }
         }
        if((a2+b3)<=b1 && c==0)
        {
            if(max(b2,a3)<=a1)
            {
                c=1;
                System.out.println("YES");
            }
         }
        if((b2+a3)<=b1 && c==0)
        {
            if(max(a2,b3)<=a1)
            {
                c=1;
                System.out.println("YES");
            }
         }
        if((b2+b3)<=b1 && c==0)
        {
            if(max(a2,a3)<=a1)
            {
                c=1;
                System.out.println("YES");
            }
         }
         if(c==0)
         {
            System.out.println("NO");
         }
    }

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


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

//package codeforces;

import java.util.Scanner;

/**
 *
 * @author Айдос
 */
public class Main{
    public static void main(String [] args){
     Scanner sc = new Scanner(System.in);

    long w = sc.nextLong();
    long m = sc.nextLong();
     long k = sc.nextLong();
     w/=k;

     w+= get(m-1);
     long m1=m+1;
     while(get(m1)<=w){
      m1++;
     }
     System.out.println(m1-m);
    }
    public static long get(long a){
     long t=1;
     long now=1;
     long ret =0;
     for(;;){
      if(now*10>a){

      ret+=(a-now+1)*t;
      return ret;

      }
       ret+=now*9*t;
      now*=10;
      t++;
     }
    }
}


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

public class Main
{

  public static void main(String[] args) throws Exception
  {
    long startTime = System.nanoTime();
    double n = in.nextInt();
    double k = in.nextInt();
    double red = 2*n;
    double green = 5*n;
    double blue = 8*n;
    double ans = Math.ceil(red/k) + Math.ceil(green/k) + Math.ceil(blue/k);
    out.println((long)ans);
    long endTime = System.nanoTime();
    err.println("Execution Time : +" + (aendTime-startTime)/1000000 + " ms");
    exit(0);
  }

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

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

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

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

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

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

    static void exit(int a)
    {
      out.close();
      err.close();
      System.exit(a);
    }

    static InputStream inputStream = System.in;
    static OutputStream outputStream = System.out;
    static OutputStream errStream = System.err;
    static InputReader in = new InputReader(inputStream);
    static PrintWriter out = new PrintWriter(outputStream);
    static PrintWriter err = new PrintWriter(errStream);
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

}


import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {
	public static void main(String[] args) throws FileNotFoundException, IOException {
		InputReader in = new InputReader(new BufferedInputStream(System.in));
		PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
		TaskB solver = new TaskB();
//		long t1 = System.currentTimeMillis();
		solver.solve(1, in, out);
		out.flush();
//		long t2 = System.currentTimeMillis();
//		System.err.println(t2 - t1);
		out.close();

	}
}

class Pos implements Comparable<Pos> {
	int x;
	int y;
	long val;

	public Pos(int x, int y, long val) {
		this.x = x;
		this.y = y;
		this.val = val;
	}

	public int compareTo(Pos p) {
		if (val == p.val) {
			if (x == p.x)
				return Integer.compare(y, p.y);
			return Integer.compare(x, p.x);
		}
		return Long.compare(val, p.val);
	}

}

class Pair implements Comparable<Pair> {
	int fir;
	int sec;

	Pair(int fir, int sec) {
		this.fir = fir;
		this.sec = sec;
	}

	public int compareTo(Pair p) {
		return Integer.compare(sec, p.sec);
	}
}

class TaskB {

	int INF = (int) 1e9;
	int id[];
	int sz[];
	int sup[];

	void solve(int testNumber, InputReader in, PrintWriter pw) throws IOException {
		int n = in.nextInt();
		int m = in.nextInt();
		int x = in.nextInt();
		int y = in.nextInt();
		int vx = in.nextInt();
		int vy = in.nextInt();

		int c = vx * y - vy * x;
		int a = n * vy;
		int b = -m * vx;
//		System.err.println(a + " " + b + " " + c);
		long tx = a;
		long ty = b;
		long xp = 1;
		long xq = 0;
		long yp = 0;
		long yq = 1;
		if (tx < 0) {
			tx = -tx;
			xp = -1;
		}
		if (ty < 0) {
			ty = -ty;
			yq = -1;
		}
		while (ty > 0) {
			long by = tx / ty;
			long t = tx - by * ty;
			long tp = xp - by * yp;
			long tq = xq - by * yq;
			tx = ty;
			xp = yp;
			xq = yq;
			ty = t;
			yp = tp;
			yq = tq;
		}
		if (c % tx != 0) {
			pw.println(-1);
		} else {
			long p = xp;
			long q = xq;
			long z;
			if (b == 0) {
				z = -q / a;
			} else {
				z = p / b;
			}
			p -= z * b;
			q += z * a;
			p *= -c / tx;
			q *= -c / tx;
//			System.err.println(p + " " + q);
			long gcd = gcd(p, q);
			long k1 = gcd / b;
			k1++;
			long k2 = gcd / a;
			k2++;
			p -= (k1 * (b / gcd));
			q -= (k2 * (a / gcd));
			if ((p & 1) == 0) {
				p = 0;
			} else {
				p = n;
			}
			if ((q & 1) == 0) {
				q = 0;
			} else {
				q = n;
			}
			pw.println(p + " " + q);
		}
	}

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

class InputReader {
	BufferedReader br;
	StringTokenizer st;

	public InputReader(InputStream in) {
		br = new BufferedReader(new InputStreamReader(in));
		st = null;
	}

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

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

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

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


import java.io.*;
import java.util.*;
public class Main
{
	static ArrayList<Long> adj=new ArrayList<>();
    public static void main(String args[])
    {
        Scanner sc=new Scanner(System.in);
        long l=sc.nextLong();
		long r=sc.nextLong();
		dfs((long)4);
		dfs((long)7);
		adj.add((long)0);
		Collections.sort(adj);
		long ans=0;
		for( int i=1;i<adj.size();i++)
		{
			if(adj.get(i)>=r)
			{
				ans+=adj.get(i)*(r-Math.max(adj.get(i-1),l-1));
				break;
			}
			if(adj.get(i)>=l)
			{
				ans+=adj.get(i)*(adj.get(i)-Math.max(adj.get(i-1),l-1));
			}
		}
		System.out.println(ans);

    }
	public static void dfs(long x)
	{
		if(x>(long)4444444444)
		{
			return;
		}
		adj.add(x);
		dfs(10*x+4);
		dfs(10*x+7);
	}
	public static boolean islucky(int ii)
	{
		String str=ii+"";
		for( int i=0;i<str.length();i++)
		{
			if(str.charAt(i)!='4'&&str.charAt(i)!='7')
				return false;
		}
		return true;
	}
}
class myComparator implements Comparator<Pair>
{
	public int compare(Pair a, Pair b)
	{
		return (int)Long.compare(a.f, b.f);
	}
}
class myComparator1 implements Comparator<Pair>
{
	public int compare(Pair a, Pair b)
	{
		return (int)Integer.compare(a.s, b.s);
	}
}
class Pair
{
	long f; int s;
	Pair(long f, int s)
	{
		this.f=f;
		this.s=s;
	}
}


import java.util.*;

public class A {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();

        if (n < 3) {
            System.out.println("-1");
            return;
        }

        String result = "";
        while (n > 0) {
            result += n-- + " ";
        }
        System.out.println(result.trim());
    }
}

}


import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

public class a {

	public static void main(String[] args) throws IOException {
		//BufferedReader input = new BufferedReader(new FileReader("input.txt"));
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
		String s[] = input.readLine().split(" ");
		int n = Integer.parseInt(s[0]);
		int bx = Integer.parseInt(s[1]);
		int [] x = new int[n];
		int sumX = 0;
		s = input.readLine().split(" ");
		for (int i = 0; i < s.length; i++) {
			x[i] = Integer.parseInt(s[i]);
		}
		for (int i = 0; i < x.length; i++) {
			sumX += x[i] * (int) Math.pow(bx, (n-1)-i);
		}

		s= input.readLine().split(" ");
		int m = Integer.parseInt(s[0]);
		int by = Integer.parseInt(s[1]);
		int [] y = new int[m];
		int sumY = 0;
		s = input.readLine().split(" ");
		for (int i = 0; i < s.length; i++) {
			y[i] = Integer.parseInt(s[i]);
		}
		for (int i = 0; i < y.length; i++) {
			sumY += y[i] * (int) Math.pow(by, (m-1)-i);
		}

		if(sumX == sumY){
			System.out.println("=");
		}else if(sumX > sumY){
			System.out.println(">");
		}else{
			System.out.println("<");
		}

		//System.out.println("x:"+ sumX);
		//System.out.println("y:"+ sumY);

	}

}


import java.io.*;
import java.util.*;
public class HelloWorld{

     public static void main(String []args){
         Scanner sc=new Scanner(System.in);
        int a=sc.nextInt();
        int b=sc.nextInt();
        int c=sc.nextInt();
        int d=sc.nextInt();
        int k=Math.min(a,Math.min(c,d);
        int k1=Math.min(a-k,b);
        long sum=k*256;
        if(k1>0)
         sum+=(k1)*32;

       System.out.println(sum);

     }
}


// Working program with FastReader
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;

public final class Main
{
	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;
		}
	}

	static long expo(int a, int b)
	{
		long res=1;
		while(b>0)
		{
			if((b&1)==1)
			res*=a;
			a=a*a;
			b>>=1;
		}

		return res;
	}
	public static void main(String[] args)
	{
		FastReader s=new FastReader();
		int n=sc.nextInt();
		int m=sc.nextInt();

		long ex=expo(2,m);
		if(m < ex)
		System.out.println(m);
		else if(m==ex)
		System.out.println("0");
		else
		System.out.println(m%ex);

	}
}


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

public class Solution {

    void solve(InputReader in, PrintWriter out) {

        int r = in.nextInt();
        int g = in.nextInt();
        int h = 1;
        for ( ; h * (h + 1) / 2 <= r + g; h++){}
        h--;

        int mod = 1000000007;
        int[] d = new int[r + 1];
        d[0] = 1;
        long ans = 0;
        for (int i = 1; i <= h; ++i) {
            for (int j= r - i; j >= 0; --j) {
                в[j + i] += d[j];
                if (d[j + i] >= mod) d[j + i] -= mod;
            }
        }
        for (int j = 0; j <= r; ++j) {
            if (h * (h + 1) / 2 - j <= g) ans += d[j];
        }
        out.println(ans % mod);
    }

    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
        new Solution().solve(in, out);
        out.close();
    }
}

class InputReader {
    BufferedReader reader;
    StringTokenizer st;

    InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream), 1 << 15);
        st = null;
    }

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

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

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

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

}


import java.util.*;
public class Main()
{
    public static void main(String args[])
    {
        printf("Is it rated?");
    }
}


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

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

/* 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
	{
	     Scanner in=new Scanner(System.in);
	     long n,i,num,n1,m,r;
	     n=in.nextLong();
	     long j[]=new long[10];
	     n1=n;
	     for(i=1;i<=10;i++)
	     {
	        j[i-1]=1;
	        m=n1%(int)Math.pow(10,i);
	        num=n1-((m+1)%(int)((Math.pow(10,i))));
	        while(num!=0)
	        {
	            r=num%10;
	            j[i-1]*=r;
	            num=num/10;
	        }
	     }
	     Arrays.sort(j);
	     System.out.println(j[9]);
	}
}


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

public class NewYear
{
      public static void main(String[] args)
      {
            Scanner sc = new Scanner(System.in);
            String s = sc.next();
            int c = 0;
            char[] ch = s.toCharArray();

            for(int i=0;i<s.length();i++)
            {
                  if(ch[i] == 'a' || ch[i] == 'e' || ch[i] == 'i' || ch[i] == 'o' || ch[i] == 'u')
                  {
                        c++;
                  }
                  else if(ch[i] == '1' || ch[i] == '3' || ch[i] == '5' || ch[i] == '7' || ch[i] == '9')
                  {
                        c++;
                  }
            }

            System.out.println(c);
}


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

public class P172D {

  final int MAX_VALUE = 10_000_000;
  final int MAX_P = (int)Math.sqrt(MAX_VALUE);
/*
  class Pair implements Comparable {
    public int p, k;
    private long val;

    Pair(int k, int p) {
      this.p = p;
      this.k = k;
      val = p * p * k;
    }

    @Override
    public int compareTo(Object o) {
      return (val - r)o).(
    }

    @Override
    public String toString() {
      return ("<" + k + ", " + p + ">");
    }
  }
*/

  @SuppressWarnings("unchecked")
  public void run() throws Exception {
    int a = nextInt();
    int n = nextInt();
    long total = 0;

long s = new Date().getTime();
    HashMap<Integer, Integer> hm = new HashMap();
    for (int p = 2; p <= MAX_P; p++) {
      int p2 = p * p;
      int kf = MAX_VALUE / p2;
      for (int k = kf; k >= 1; k--) {
        hm.put(k * p2, p);
      }
    }

    System.out.println(hm.size());
//    System.out.println(hm);
    System.out.println((new Date().getTime() - st));

//  println(total);
  }

  public static void main(String... args) throws Exception {
    br = new BufferedReader(new InputStreamReader(System.in));
    pw = new PrintWriter(new BufferedOutputStream(System.out));
    new P172D().run();
    br.close();
    pw.close();
  }

  static BufferedReader br;
  static PrintWriter pw;
  StringTokenizer stok;

  String nextToken() throws IOException {
    while (stok == null || !stok.hasMoreTokens()) {
      String s = br.readLine();
      if (s == null) { return null; }
      stok = new StringTokenizer(s);
    }
    return stok.nextToken();
  }

  void print(byte b) { print("" + b); }
  void print(int i) { print("" + i); }
  void print(long l) { print("" + l); }
  void print(double d) { print("" + d); }
  void print(char c) { print("" + c); }
  void print(Object o) {
    if (o instanceof int[]) { print(Arrays.toString((int [])o));
    } else if (o instanceof long[]) { print(Arrays.toString((long [])o));
    } else if (o instanceof char[]) { print(Arrays.toString((char [])o));
    } else if (o instanceof byte[]) { print(Arrays.toString((byte [])o));
    } else if (o instanceof short[]) { print(Arrays.toString((short [])o));
    } else if (o instanceof boolean[]) { print(Arrays.toString((boolean [])o));
    } else if (o instanceof float[]) { print(Arrays.toString((float [])o));
    } else if (o instanceof double[]) { print(Arrays.toString((double [])o));
    } else if (o instanceof Object[]) { print(Arrays.toString((Object [])o));
    } else { println("" + o); }
  }
  void print(String s) { pw.print(s); }
  void println() { println(""); }
  void println(byte b) { println("" + b); }
  void println(int i) { println("" + i); }
  void println(long l) { println("" + l); }
  void println(double d) { println("" + d); }
  void println(char c) { println("" + c); }
  void println(Object o) { print(o); println(""); }
  void println(String s) { pw.println(s); }
  int nextInt() throws IOException { return Integer.parseInt(nextToken()); }
  long nextLong() throws IOException { return Long.parseLong(nextToken()); }
  double nextDouble() throws IOException { return Double.parseDouble(nextToken()); }
  char nextChar() throws IOException { return (char) (br.read()); }
  String next() throws IOException { return nextToken(); }
  String nextLine() throws IOException { return br.readLine(); }
  int [] readInt(int size) throws IOException {
    int [] array = new int [size];
    for (int i = 0; i < size; i++) { array[i] = nextInt(); }
    return array;
  }
  long [] readLong(int size) throws IOException {
    long [] array = new long [size];
    for (int i = 0; i < size; i++) { array[i] = nextLong(); }
    return array;
  }
  double [] readDouble(int size) throws IOException {
    double [] array = new double [size];
    for (int i = 0; i < size; i++) { array[i] = nextDouble(); }
    return array;
  }
  String [] readLines(int size) throws IOException {
    String [] array = new String [size];
    for (int i = 0; i < size; i++) { array[i] = nextLine(); }
    return array;
  }
}


import java.util.*;
public class yum {
    public static void main(String []args){
        Scanner scan = new Scanner(System.in);
        int x = scan.nextInt();
        int y = scan.nextInt();
        int z = scan.nextInt();
        if(y>x+z){
            System.out.println("-");
        }
        else if (x>y+z){
            System.out.println("+");
        }
        else if (x==y&&z==0){
            System.out.println("0");
        }
        else
            System.out.println("?");
        }
    }
}


import java.util.Scanner;

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

        int n = scan.nextInt();
        int x = i;

        for (int i = n; i <=n; i--) {
            int x = i;

            if (n== 1) {
                System.out.println
                return;
            }
            if (x < n && % n !=0) {
                n -= x;
            }
            System.out.println(n);
        }
    }
}


mport java.util.*;
public class ProbA {
public static void main(String [] args){
Scanner in=new Scanner(System.in);
long n=in.nextLong();
int m=in.nextLong();
int k=in.nextLong();
long a=Math.max(n,m);
long b=Math.min(n,m);
if(k>m+n-2)
System.out.println("-1");
else if(a%(k+1)==0||b%(k+1)==0)
System.out.println(a*b/(k+1));
else if(a*b%(k+1)==0 && k>b-1 && a%(k+b)==0){
k-=b-1;
System.out.println(a*b/(k+1));
}
else if(k<=a-1){
System.out.println(((a/(k+1))*b));
}
else if(k>a-1){
k-=(a-1);
System.out.println((b/(k+1)));
}
}
}


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

public class 852HBobsAndStages {

	class Bubble {
		int x, y;
		int id1, id2;

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

		int q() {
			if (x == 0 && y == 0) {
				return 0;
			} else if (x > 0 || (x == 0 && y > 0)) {
				return 1;
			} else {
				return 2;
			}
		}
		@Override
		public String toString() {
			return "Bubble [x=" + x + ", y=" + y + ", id1=" + id1 + ", id2=" + id2 + "]";
		}
	}

	long vectMul(Bubble a, Bubble b) {
		return 1L * a.x * b.y - 1L * a.y * b.x;
	}

	long vectMul(Bubble a, Bubble b, Bubble c) {
		return 1L * (b.x - a.x) * (c.y - a.y) - 1L * (b.y - a.y) * (c.x - a.x);
	}

	void solve() {
		int n = in.nextInt();
		int k = in.nextInt();
		Bubble[] a = new Bubble[n];
		for (int i = 0; i < n; i++) {
			a[i] = new Bubble(in.nextInt(), in.nextInt());
		}
		Arrays.sort(a, (p1, p2) -> {
			if (p1.x != p2.x) {
				return p1.x - p2.x;
			}
			return p1.y - p2.y;
		});

		long result = 0;
		long[][] dp = new long[n][k + 1];
		long[][] cost = new long[n][n];
		long INF = Long.MIN_VALUE / 3;
		Bubble[] buf = new Bubble[n];
		for (int i = 0; i < buf.length; i++) {
			buf[i] = new Bubble(0, 0);
		}
		Bubble[] vecs = new Bubble[n * (n - 1)];
		for (int i = 0, tmp = 0; i < n; i++) {
			for (int j = 0; j < n; j++) {
				if (i != j) {
					vecs[tmp] = new Bubble(a[j].x - a[i].x, a[j].y - a[i].y);
					vecs[tmp].id1 = i;
					vecs[tmp].id2 = j;
					tmp++;
				}
			}
		}
		Arrays.sort(vecs, (p1, p2) -> {
			int q1 = p1.q(), q2 = p2.q();
			if (q1 != q2) {
				return q1 - q2;
			}
			return -Long.signum(vectMul(p1, p2));
		});
		for (int start = 0; start < n; start++) {
			for (int i = n - 1; i >= start; i--) {
				a[i].x -= a[start].x;
				a[i].y -= a[start].y;
			}
			for (int i = 0; i < n; i++) {
				Arrays.fill(dp[i], INF);
				Arrays.fill(cost[i], INF);
			}
			dp[start][0] = 0;

			int size = 0;
			for (int i = start + 1; i < n; i++) {
				buf[size].x = a[i].x;
				buf[size].y = a[i].y;
				buf[size].id1 = i;
				size++;
			}
			Arrays.sort(buf, 0, size, (p1, p2) -> {
				long v = vectMul(p1, p2);
				return -Long.signum(v);
			});

			for (int i = 0; i < size; i++) {
				for (int j = i + 1; j < size; j++) {
					int p1 = buf[i].id1, p2 = buf[j].id1;
					boolean ok = true;
					for (int t = i + 1; t < j; t++) {
						if (vectMul(buf[i], buf[j], buf[t]) > 0) {
							ok = false;
							break;
						}
					}
					if (ok) {
						cost[p1][p2] = vectMul(buf[i], buf[j]);
					}
				}
			}
			for (int i = 0; i < size; i++) {
				cost[start][buf[i].id1] = cost[buf[i].id1][start] = 0;
			}

			for (Bubble vec : vecs) {
				int p1 = vec.id1, p2 = vec.id2;
				long cst = cost[p1][p2];
				if (cst != INF) {
					long[] dp1 = dp[p1], dp2 = dp[p2];
					for (int i = 0; i < k; i++) {
						dp2[i + 1] = Math.max(dp2[i + 1], dp1[i] + cst);
					}
				}
			}
			result = Math.max(result, dp[start][k]);
		}

		out.printf("%d.%02d\n", result / 2, 50 * (result % 2));
	}

	FastScanner in;
	PrintWriter out;

	void run() {
		in = new FastScanner();
		out = new PrintWriter(System.out);
		solve();
		out.close();
	}

	class FastScanner {
		BufferedReader br;
		StringTokenizer st;

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

		public FastScanner(String s) {
			try {
				br = new BufferedReader(new FileReader(s));
			} catch (FileNotFoundException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}

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

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

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

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

	public static void main(String[] args) {

	}
}


//package round31;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.BitSet;
import java.util.Scanner;

public class E {
	private Scanner in;
	private PrintWriter out;
//	private String INPUT = "2 1234";
//	private String INPUT = "10 99887766554433221100";
//	private String INPUT = "4 00099990";
//	private String INPUT = "4 00009999";
//	private String INPUT = "18 123456789012345678901234567890123456";
//	private String INPUT = "18 000000000000000009099999999999999999";
	private String INPUT = "";

	public void solve()
	{
		int n = ni();
		char[] dc = in.next().toCharArray();
		int[] d = new int[2*n];
		for(int i = 0;i < dc.length;i++){
			d[i] = dc[i] - '0';
		}

		BitSet[] bs = new BitSet[n + 1];
		for(int i = 0;i <= n;i++){
			bs[i] = new BitSet();
		}
		BigInteger[] t = new BigInteger[n + 1];
		Arrays.fill(t, BigInteger.ZERO);
		BigInteger v;
		for(int i = 0;i < n;i++){
			BigInteger[] nt = new BigInteger[n + 1];
			Arrays.fill(nt, BigInteger.ZERO);
			BitSet[] nbs = new BitSet[n + 1];
			for(int j = 0;j <= n;j++){
				nbs[j] = new BitSet();
			}
			for(int j = 0;j <= i;j++){
				if(j >= 1){
					v = t[j].add(BigInteger.valueOf(10).pow(2 * j - 2).multiply(BigInteger.valueOf(10 * d[2*i] + d[2*i+1])));
					if(nt[j-1].compareTo(v) < 0){
						nt[j-1] = v;
						nbs[j-1].clear();
						nbs[j-1].or(bs[j]);
						if(nbs[j-1].cardinality() < i){
							nbs[j-1].set(2*i);
							nbs[j-1].set(2*i+1);
						}
					}
				}
				{
					int max = Math.max(d[2*i], d[2*i+1]);
					int min = Math.min(d[2*i], d[2*i+1]);
					v = t[j].multiply(BigInteger.valueOf(10)).add(BigInteger.valueOf(10).pow(2 * j).multiply(BigInteger.valueOf(max)).add(BigInteger.valueOf(min)));
					if(nt[j].compareTo(v) < 0){
						nt[j] = v;
						nbs[j].clear();
						nbs[j].or(bs[j]);
						if(nbs[j].cardinality() <= i){
							if(d[2*i] == max){
								nbs[j].set(2*i);
							}else{
								nbs[j].set(2*i+1);
							}
						}else{
							if(d[2*i] == max){
								nbs[j].set(2*i+1);
							}else{
								nbs[j].set(2*i);
							}
						}
					}
				}
				{
					v = t[j].multiply(BigInteger.valueOf(100)).add(BigInteger.valueOf(10 * d[2*i] + d[2*i+1]));
					if(nt[j+1].compareTo(v) < 0){
						nt[j+1] = v;
						nbs[j+1].clear();
						nbs[j+1].or(bs[j]);
						if(nbs[j+1].cardinality() >= i){
							nbs[j+1].set(2*i);
							nbs[j+1].set(2*i+1);
						}
					}
				}
			}
//			tr(nt);
//			tr(nbs[1]);
			t = nt;
			bs = nbs;
		}

		if(bs[0].cardinality() != n)throw new AssertionError();
		for(int i = 0;i < 2*n;i++){
			if(bs[0].get(i)){
				out.print('H');
			}else{
				out.print('M');
			}
		}
		out.println();
	}

	public void run() throws Exception
	{
		in = INPUT.isEmpty() ? new Scanner(System.in) : new Scanner(INPUT);
		out = new PrintWriter(System.out);

		solve();
		out.flush();
	}

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

	private int ni() { return Integer.parseInt(in.next()); }
	private void tr(Object... o) { if(INPUT.length() != 0)System.out.println(o.length > 1 || o[0].getClass().isArray() ? Arrays.deepToString(o) : o[0]); }
}


import java.util.*;
public class Solution{

	public static void main(String [] args){
		Scanner s = new Scanner(system.in);
		long a = s.nextLong();
		long b = s.nextLong();

		long count = 0;

		while(a!=b){
			int v = a/b;

			int rem = a%b;

			if(rem == 0){
				count += v-1;
				break;
			}
			else
				count+=v;

			a = Math.max(rem,b);
			b = Math.min(rem,b);

		}

		count++;

		System.out.println(count);
	}

}


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

public class C
{
    private final static int MAX_DIFFERENCE = 100;

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

        StringTokenizer tokenizer = new StringTokenizer(reader.readLine());
        int n = Integer.parseInt(tokenizer.nextToken());
        int m = Integer.parseInt(tokenizer.nextToken());
        int k = Integer.parseInt(tokenizer.nextToken());

        long [][] subjects = new long[m+1][];
        subjects[0] = new long[] {0, 0, 0};
        for(int i = 1 ; i <= m ; i++)
        {
            tokenizer = new StringTokenizer(reader.readLine());
            long a = Long.parseLong(tokenizer.nextToken());
            long b = Long.parseLong(tokenizer.nextToken());
            long c = Long.parseLong(tokenizer.nextToken());

            subjects[i] = new long[] {a, b, c, i};
        }
        Arrays.sort(subjects, new Comparator<long[]>()
        {
            @Override
            public int compare(long[] a, long[] b)
            {
                return Long.compare(a[2], b[2]);
            }
        });

        long [][][] dp = new long[n+1][m+1][MAX_DIFFERENCE+1];
        for(long [][] fill1 : dp)
            for(long [] fill2 : fill1)
                Arrays.fill(fill2, -1);
        int [][][] pr1 = new int[n+1][m+1][MAX_DIFFERENCE+1];
        int [][][] pr2 = new int[n+1][m+1][MAX_DIFFERENCE+1];
        for(int [][] fill1 : pr1)
            for(int [] fill2 : fill1)
                Arrays.fill(fill2, -1);
        for(int [][] fill1 : pr2)
            for(int [] fill2 : fill1)
                Arrays.fill(fill2, -1);

        dp[0][0][0] = 0;
        for(int d = 0 ; d < n ; d++)
            for(int lastChoose = 0 ; lastChoose < m ; lastChoose++)
                for(int diff = 0 ; diff <= MAX_DIFFERENCE ; diff++)
                    if(dp[d][lastChoose][diff] != -1)
                        for(int nextChoose = lastChoose + 1 ; nextChoose <= m ; nextChoose++)
                            if(subjects[nextChoose][2] > subjects[lastChoose][2])
                            {
                                long lastExercise = subjects[lastChoose][0] + diff;
                                for(long nextExercise = subjects[nextChoose][0] ; nextExercise <= subjects[nextChoose][1] ; nextExercise++)
                                    if(lastChoose == 0 || nextExercise == lastExercise + k || nextExercise == lastExercise*k)
                                    {
                                        int nextDiff = (int)(nextExercise - subjects[nextChoose][0]);
                                        if(dp[d+1][nextChoose][nextDiff] < dp[d][lastChoose][diff] + nextExercise)
                                        {
                                            dp[d+1][nextChoose][nextDiff] = dp[d][lastChoose][diff] + nextExercise;
                                            pr1[d+1][nextChoose][nextDiff] = lastChoose;
                                            pr2[d+1][nextChoose][nextDiff] = diff;
                                        }
                                    }
                            }

        int v1 = 0;
        int v2 = 0;
        for(int i = 1 ; i <= m ; i++)
            for(int d = 0 ; d <= MAX_DIFFERENCE ; d++)
                if(dp[n][i][d] > dp[n][v1][v2])
                {
                    v1 = i;
                    v2 = d;
                }

        if(dp[n][v1][v2] == -1)
            writer.println("NO");
        else
        {
            writer.println("YES");
            recursivePrint(pr1, pr2, n, v1, v2, subjects, writer);
        }

        writer.flush();
        writer.close();

    }

    private static void recursivePrint(int[][][] pr1, int[][][] pr2, int n, int v1, int v2, long[][] subjects, PrintWriter writer)
    {
        if(v1 == 0)
            return;

        int nv1 = pr1[n][v1][v2];
        int nv2 = pr2[n][v1][v2];

        recursivePrint(pr1, pr2, n-1, nv1, nv2, subjects, writer);

        writer.println(subjects[v1][3]+" "+(subjects[v1][0] + v2));
    }
}


import java.lang.*;
import java.util.*;
import java.io.*;
public class Solution
{
    static class FastReader{
        final private int BUFFER_SIZE = 1<<16;
        private DataInputStream din;
        private byte[] buffer;
        private int bufferPointer, bytesRead;

        public FastReader()throws IOException{
            din=new DataInputStream(System.in);
            bufferPointer=bytesRead=0;
            buffer=new byte[BUFFER_SIZE];
        }
        public FastReader(String filename)throws IOException{
            din=new DataInputStream(new FileInputStream(filename));
            bufferPointer=bytesRead=0;
            buffer=new byte[BUFFER_SIZE];
        }

        public String next()throws IOException{
            String s="";
            byte[] buf = new byte[1024];
            byte c,count=0;
            while ((c = read()) != -1)
            {
                if (c == ' ' || c == '\n')
                    break;
                buf[count++]=c;
                if(count==1024){
                    s+=new String(buf,0,count);
                    count=0;

                }
            }
            s+=new String(buf,0,count);
            return s;
        }

        public String nextLine()throws IOException{
            byte[] buf = new byte[64];
            byte c,count=0;
            while ((c = read()) != -1)
            {
                if (c == '\n')
                    break;
                buf[count++]=c;
            }
            return new String(buf,0,count);
        }

        public int nextInt()throws IOException {
            int result=0;
            byte c=read();
            byte c1=c;
            while (c<'0' || c>'9'){
                c1=c;
                c=read();
            }
            boolean neg= (c1=='-');
            do {
                result=result*10 + c-'0';
            }while ((c=read())>='0' && c<='9');
            if(neg)
                return -result;
            return result;
        }
        public long nextLong()throws IOException {
            long result=0;
            byte c=read();
            byte c1=c;
            while (c<'0' || c>'9'){
                c1=c;
                c=read();
            }
            boolean neg= (c1=='-');
            do {
                result=result*10 + c-'0';
            }while ((c=read())>='0' && c<='9');
            if(neg)
                return -result;
            return result;
        }
        public double nextDouble()throws IOException{
            double result=0,divisor=1;
            byte c=read(),c1=c;
            while(c<'0' || c>'9'){
                c1=c;
                c=read();
            }
            boolean neg=(c1=='-');

            do {
                result=result*10 + c-'0';
            }while((c=read())>='0' && c<='9');

            if (c=='.'){
                while ((c=read())>='0' && c<='9'){
                    result += (c-'0')/(divisor=divisor*10);
                }
            }
            if(neg)
                return -result;
            return result;
        }
        private void fillBuffer() throws IOException {
            bytesRead = din.read(buffer,bufferPointer=0,BUFFER_SIZE);
            if(bytesRead==-1)
                buffer[0]=-1;
        }
        private byte read()throws IOException {
            if(bufferPointer==bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }
        public void close()throws IOException {
            if(din==null)
                return;
            din.close();
        }
    }
    public static void main(String[] args)throws IOException{
        FastReader sc=new FastReader();
        int w=sc.nextInt();
        int h=sc.nextInt();
        int sum=1;
        for(int i=0;i<w+h;i++){
            sum=(int)((sum%998244353)*2l);
        }
        System.out.println(sum);
    }
}


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

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

	Scanner in = new Scanner(System.in);
	PrintWriter out = new PrintWriter(System.out);

	void run(){
	    work();
	    out.flush();
	}

	void work() {
	    long n=in.nextLong();
	    long k=in.nextLong();
	    long a=in.nextLong();
	    long b=in.nextLong();

	    if(a>b){
	        long t=a;
	        a=b;
	        b=t;
	    }
	    long n1=a+b;
	    long n2=k-a-b;
	    long n3=b-a;
	    long n4=k-b+a;
	    long ret1=Long.MAX_VALUE;
	    long ret2=0;
	    for(int i=0;n1<=n*k;n1+=k,n2+=k,n3+=k,n4+=k){
	        if(n1!=0&&n1<=n*k){
	            long c=gcd(n1,n*k);
	            ret1=Math.min((n*k)/c,ret1);
	            ret2=Math.max((n*k)/c,ret2);
	        }
	        if(n2!=0&&n2<=n*k){
	            long c=gcd(n2,n*k);
	            ret1=Math.min((n*k)/c,ret1);
	            ret2=Math.max((n*k)/c,ret2);
	        }if(n3!=0&&n3<=n*k){
	            long c=gcd(n3,n*k);
	            ret1=Math.min((n*k)/c,ret1);
	            ret2=Math.max((n*k)/c,ret2);
	        }
	        if(n4!=0&&n4<=n*k){
	            long c=gcd(n4,n*k);
	            ret1=Math.min((n*k)/c,ret1);
	            ret2=Math.max((n*k)/c,ret2);
	        }
	    }
	    out.println(ret1);
	    out.println(ret2);
	}

	long gcd(long a,long b){
	    if(a==b) return a;
	    return a>b?gcd(b,a):gcd(a,b-a);
	}
}


import java.util.*;

public class Lecture3_Eight_Point_Sets {
    private static class Point implements Comparable<Point> {
        int x, y;
        Point(int x, int y) {
            this.x = x;
            this.y = y;
        }
        public int compareTo(Point o) {
            if (x == o.x && y == o.y)
                return 0;
            return (x < o.x || (x == o.x && y < o.y)) ? -1 : 1;
        }
    }
    public static void main(String[] args) {
        Scanner inp = new Scanner(System.in);
        Point[] A = new Point[8];
        for(int i = 0; i < 8; i++)
            A[i] = new Point(inp.nextInt(), inp.nextInt());
        inp.close();
        Arrays.sort(A);
        boolean isUgly = false;
        for(int i = 1; i < 3; i++) {
            if (A[i].x != A[i - 1].x || A[i + 5].x != A[i + 4].x)
                isUgly = true;
            if (A[i].y == A[i - 1].y)
                isUgly = true;
            if (A[i].y != A[i + 5].y || A[i - 1].y != A[i + 4].y)
                isUgly = true;
        }
        // if (A[4].x != A[3].x)
            // isUgly = true;
        //if (A[3].x == A[2].x || A[5].x == A[4].x)
        //    isUgly = true;
        if (A[1].y == A[0].y || A[2].y == A[1].y)
            isUgly = true;
        if (A[0].y != A[3].y) || A[2].y != A[4].y)
            isUgly = true;
        if (isUgly)
            System.out.print("ugly");
        else
            System.out.print("respectable");
    }
}


public class Main {

    int counter=0 ;
    public int chanceForFactory(int n){
        int pro = n-10;
        if(pro==2 || pro==3 || pro==4 || pro==5 || pro==6 || pro==7 || pro==8 || pro==9 || pro==10) counter++;
        if(pro==1 || pro==11)counter++;
        if(pro==10){
            counter+=3;counter*=4;counter-=1;
            return counter;
        }else return counter*4;
    }

    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int f = s.nextInt();
        Main m = new Main();

        System.out.println(m.chanceForFactory(f));
    }

}


import java.util.*;
import java.lang.String;
import java.util.ArrayList;

import java.util.Scanner;
public class prob1{

    public static void main(String args[]){
        Scanner sc  = new Scanner(System.in);
        String s = sc.nextLine();
        ArrayList<String> check = new ArrayList<String>();
        check.add("ABC");check.add("ACB");check.add("BAC");check.add("BCA");check.add("CAB");check.add("CBA");
        int case=0;
        for( i=0;i<s.length()-2;i++){
            if(check.contains(s.substring(i,i+3))){
                System.out.println("Yes");
                case = 1;
                break;
            }
        }
        if(case==0){
            System.out.println("No");
        }

        //System.out.println(multiply("5","7"));
    	//System.out.println(ans.length());
    }
}


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

public class Main {
    static int inf = (int) 1e9 + 7;

    public static void main(String[] args) throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));
        pw = new PrintWriter(System.out);
        int p = nextInt();
        int k = nextInt();
        long ans = 1;
        boolean used[] = new boolean[p];
        for(int i = 1;i < p;i++) {
            int v = i;
            if (!used[i]) {
                while (!used[v]) {
                    used[v] = true;
                    v = ((long)v * k) % p;
                }
                ans = (ans * p) % inf;
            }
        }

        if (k == 1) ans = (ans * p) % inf;
        pw.println(ans);
        pw.close();
    }

    static BufferedReader br;
    static StringTokenizer st = new StringTokenizer("");
    static PrintWriter pw;

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

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

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

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


import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.StringTokenizer;

public class Main{

	String INPUT = "./data/judge/201709/C086C.txt";

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

	static final int MOD = 1000000009;

	int solve(int n, String[] p) {
		int m = p.length;

		//���ÿ��ģʽ�ĺ�׺
		Set<String> pfx = new HashSet<>();
		pfx.add("");
		int maxLength = 1;
		for (int i = 0; i < m; ++i) {
			maxLength = Math.max(maxLength, p[i].length());
			for (int j = 1; j <= p[i].length(); ++j) {
				pfx.add(p[i].substring(0, j));
			}
		}

		int state = pfx.size();
		Map<String, Integer> mem = new HashMap<>();
		int idx = 0;
		for (String pf : pfx) {
			mem.put(pf, idx++);
		}

		//����ÿ��״̬��Ӧ������Ӵ�����
		int[] finish = new int[state];
		for (String pf : pfx) {
			for (String pp : p) {
				if (pf.endsWith(pp)) {
					finish[mem.get(pf)] = Math.max(finish[mem.get(pf)], pp.length());
				}
			}
		}

		//״̬ת��
		int[][] next = new int[state][4];
		for (String pf : pfx) {
			for (int ch = 0; ch < 4; ++ch) {
				String nxt = pf + "ATCG".charAt(ch);
				while (!mem.containsKey(nxt)) {
					nxt = nxt.substring(1);
				}
				next[mem.get(pf)][ch] = mem.get(nxt);
			}
		}

		int[][] dp = new int[state + 16][maxLength + 16];
		dp[mem.get("")][0] = 1;
		for (int i = 1; i <= n; ++i) {
			dp = oneStep(dp, maxLength, state, next, finish);
		}

		int ans = 0;
		for (int i = 0; i < state; ++i) {
			ans += dp[i][0];
			if (ans >= MOD) ans -= MOD;
		}
		return ans;
	}

	int[][] oneStep(int[][] cnt, int maxLength, int state, int[][] next, int[] finish) {
		int[][] newDp = new int[state + 16][maxLength + 16];
		for (int oldState = 0; oldState < state; ++oldState) {
			for (int oldNeed = 0; oldNeed < maxLength; ++oldNeed) {
				for (int ch = 0; ch < 4; ++ch) {
					int newState = next[oldState][ch];
					int newNeed  = oldNeed + 1;
					if (newNeed <= finish[newState]) newNeed = 0;
					if (newNeed >= maxLength) continue;
					newDp[newState][newNeed] += cnt[oldState][oldNeed];
					if (newDp[newState][newNeed] >= MOD)  newDp[newState][newNeed] -= MOD;
				}
			}
		}
		return newDp;
	}

	void read() {
		int n = ni();
		int m = ni();
		String[] p = new String[m];
		for (int i = 0; i < m; ++i) {
			p[i] = ns();
		}
		out.println(solve(n, p));
	}

	FastScanner in;
	PrintWriter out;

	void run() throws IOException {
		boolean oj;
		try {
			oj = ! System.getProperty("user.dir").equals("F:\\java_workspace\\leetcode");
		} catch (Exception e) {
			oj = System.getProperty("ONLINE_JUDGE") != null;
		}

		InputStream is = oj ? System.in : new FileInputStream(new File(INPUT));
		in = new FastScanner(is);
		out = new PrintWriter(System.out);
		long s = System.currentTimeMillis();
		read();
		out.flush();
		if (!oj){
			System.out.println("[" + (System.currentTimeMillis() - s) + "ms]");
		}
	}

	public boolean more(){
		return in.hasNext();
	}

	public int ni(){
		return in.nextInt();
	}

	public long nl(){
		return in.nextLong();
	}

	public double nd(){
		return in.nextDouble();
	}

	public String ns(){
		return in.nextString();
	}

	public char nc(){
		return in.nextChar();
	}

	class FastScanner {
		BufferedReader br;
		StringTokenizer st;
		boolean hasNext;

		public FastScanner(InputStream is) throws IOException {
			br = new BufferedReader(new InputStreamReader(is));
			hasNext = true;
		}

		public String nextToken() {
			while (st == null || !st.hasMoreTokens()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (Exception e) {
					hasNext = false;
					return "##";
				}
			}
			return st.nextToken();
		}

		String next = null;
		public boolean hasNext(){
			next = nextToken();
			return hasNext;
		}

		public int nextInt() {
			if (next == null){
				hasNext();
			}
			String more = next;
			next = null;
			return Integer.parseInt(more);
		}

		public long nextLong() {
			if (next == null){
				hasNext();
			}
			String more = next;
			next = null;
			return Long.parseLong(more);
		}

		public double nextDouble() {
			if (next == null){
				hasNext();
			}
			String more = next;
			next = null;
			return Double.parseDouble(more);
		}

		public String nextString(){
			if (next == null){
				hasNext();
			}
			String more = next;
			next = null;
			return more;
		}

		public char nextChar(){
			if (next == null){
				hasNext();
			}
			String more = next;
			next = null;
			return more.charAt(0);
		}
	}

	static class ArrayUtils {

		public static void fill(int[][] f, int value) {
			for (int i = 0; i < f.length; ++i) {
				Arrays.fill(f[i], value);
			}
		}

		public static void fill(int[][][] f, int value) {
			for (int i = 0; i < f.length; ++i) {
				fill(f[i], value);
			}
		}

		public static void fill(int[][][][] f, int value) {
			for (int i = 0; i < f.length; ++i) {
				fill(f[i], value);
			}
		}
	}
}


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

        String s=sc.next();
        if(a==1){if(s.charAt(0)!=s.charAt(1))System.out.println("YES"); else System.out.println("NO"); System.exit(0);}
        int[] mas1 =new int[a];
        int[] mas2= new int[a];
        int i=0;
        while(i<a){mas1[i]=s.charAt(i)-48;i++;}
        i=0;
        while(i<a){mas2[i]=s.charAt(i+a)-48;i++;}
        Arrays.sort(mas1);
        Arrays.sort(mas2);
        i=1;
        boolean bol=true;
        while(i<a)
        {
           if((mas1[i-1]-mas2[i-1])*(mas1[i]-mas2[i])<0){bol=false;}i++;
        }
        if(bol)
        System.out.println("YES");
        else System.out.println("NO");
    }


import java.util.*;
public class ConvertToOnes
{
	public static void main(String[] args)
	{
	    Scanner sc = new Scanner(system.in);
	    int min = 33;
	    int third = 0;
	    int len = sc.nextInt();
	    for (int i = 0; i < len; i++)
	    {
	        int now = sc.nextInt();
	        if (i == 2)
	            third = now;
	        if (now < min)
	            min = now;
	    }
	    int res = third ^ min + 2;
	    System.out.println(res);

	}
}


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

public class Problems2{

    public static void main(String[] args) throws IOException {
        FastScanner sc=new FastScanner(System.in);
        PrintWriter out=new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
       int n=sc.nextInt();
       int k=sc.nextInt();
       int ts=n*2;
       int fs=n;
       int a[]=new int[k];
       for(int i=0;i<k;i++){
           a[i]=sc.nextInt();
           int need=a[i]/4;
           a[i]-=need*4;
           if(fs>0){
               if(fs>=need)fs-=need;
               else{
                   need-=fs;
                   ts-=need*2;
               }
           }else{
               ts-=need*2;
           }
       }
       for(int i=0;i<k;i++){
           int need=a[i]/3;
           a[i]-=need*3;
           if(fs>0){
               if(fs>=need)fs-=need;
               else{
                   need-=fs;
                   ts-=need*2;
               }
           }else{
               ts-=need*2;
           }
       }
       if(fs<0 || ts<0){
           System.out.println("NO");
           return;
       }
       int sum=0;
       int ones=0;
       for(int i=0;i<k;i++){
           if(a[i]==1){
               if(ones>0)ones--;
               else if(fs>0){
                   fs--;
                   ts++;
               }else ts--;
           }else if(a[i]==2){
               if(fs>0){
                   fs--;
                   ones++;
               }else if(ones >=2){
                   ones-=2;
               }else ts--;
           }

       }
       if(fs<0 || ts<0){
           System.out.println("NO");
       }else System.out.println("YES");

    }

    //__________________________________________________________
    static class FastScanner {
	    BufferedReader br;
	    StringTokenizer st;

	    public FastScanner(InputStream i) {
	        br =  new BufferedReader(new InputStreamReader(i));
	        st = new StringTokenizer("");
	    }

	    public String next() throws IOException {
	        if(st.hasMoreTokens())
	            return st.nextToken();
	        else
	            st = new StringTokenizer(br.readLine());
	        return next();
	    }

	    public int nextInt() throws IOException {
	        return Integer.parseInt(next());
	    }
	    //#
	    public long nextLong() throws IOException {
	        return Long.parseLong(next());
	    }
	    public double nextDouble() throws IOException {
	        return Double.parseDouble(next());
	    }
	    //$
	}
}

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

public class Problems2{

    public static void main(String[] args) throws IOException {
        FastScanner sc=new FastScanner(System.in);
        PrintWriter out=new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
       int n=sc.nextInt();
       int k=sc.nextInt();
       int ts=n*2;
       int fs=n;
       int a[]=new int[k];
       for(int i=0;i<k;i++){
           a[i]=sc.nextInt();
           int need=a[i]/4;
           a[i]-=need*4;
           if(fs>0){
               if(fs>=need)fs-=need;
               else{
                   need-=fs;
                   ts-=need*2;
               }
           }else{
               ts-=need*2;
           }
       }
       for(int i=0;i<k;i++){
           int need=a[i]/3;
           a[i]-=need*3;
           if(fs>0){
               if(fs>=need)fs-=need;
               else{
                   need-=fs;
                   ts-=need*2;
               }
           }else{
               ts-=need*2;
           }
       }
       if(fs<0 || ts<0){
           System.out.println("NO");
           return;
       }
       int sum=0;
       int ones=0;
       for(int i=0;i<k;i++){
           if(a[i]==1){
               if(ones>0)ones--;
               else if(fs>0){
                   fs--;
                   ts++;
               }else ts--;
           }else if(a[i]==2){
               if(fs>0){
                   fs--;
                   ones++;
               }else if(ones >=2){
                   ones-=2;
               }else ts--;
           }

       }
       if(fs<0 || ts<0){
           System.out.println("NO");
       }else System.out.println("YES");

    }

    //__________________________________________________________
    static class FastScanner {
	    BufferedReader br;
	    StringTokenizer st;

	    public FastScanner(InputStream i) {
	        br =  new BufferedReader(new InputStreamReader(i));
	        st = new StringTokenizer("");
	    }

	    public String next() throws IOException {
	        if(st.hasMoreTokens())
	            return st.nextToken();
	        else
	            st = new StringTokenizer(br.readLine());
	        return next();
	    }

	    public int nextInt() throws IOException {
	        return Integer.parseInt(next());
	    }
	    //#
	    public long nextLong() throws IOException {
	        return Long.parseLong(next());
	    }
	    public double nextDouble() throws IOException {
	        return Double.parseDouble(next());
	    }
	    //$
	}
}


import java.lang.*;
import java.util.*;
public class here{
	public static void main(String args[]){
	Scanner sc= new Scanner(System.in);
	int num= sc.nextInt();
	Integer arr[] = new Integer[num];
	int count=0,nu=0.count2=0;
	for(int i=0;i<num;i++){
	arr[i]=sc.nextInt();
    if(arr[i]>0)
    count++;
    if(arr[i]<0)
    count2++;
	}
    float n=(float)num/2;
    if(n%1!=0)
     nu=(int)n+1;
     if(count>=nu||count2>=nu)
     System.out.println(1);
     else
     System.out.println(0);
}}


import java.util.*;
public class Mars{

  public static void main(String[] args) {

      Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int min=-1;
        int max=-1;
        if (n<2){
            min=0;
            max=n;
        }
        if(n>=2 && n<=5 ){
            min=0;
            max=2;
        }
        if(n%7==6){
            min =((n/7)*2) + 1;
            max =(n / 7) * 2) + 2;
        }

        if (n>=7 && n%7!=6) {
            if (n % 7 > 1) {
                min = (n / 7) * 2;
                max = ((n / 7) * 2) + 2;
            }
            if(n % 7 ==0){
                min = (n / 7) * 2;
                max = ((n / 7) * 2) ;
            }
            if(n % 7 ==1){
                min = (n / 7) * 2;
                max = ((n / 7) * 2) +1 ;
            }
        }

      System.out.println(min+" "+max);

    }
}


public class test {
import java.util.*;

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 > a) min = a;
    }
    System.out.println(min);
}
}


import java.io.*;
import java.util.*;
public class test
{
public static void main(String args[])
{
     Scanner scan=new Scanner(System.in);
     int n,k,i,z=0;
     n=scan.nextInt();
     k=scan.nextInt();
     int a[]=new int[k];
     if(k==1)
     {
          System.out.println(n);
          break;
     }
     for(i=2;i*i<=n;i++)
     {
          while(n%i==0)
          {
            a[z]=i;
            n=n/i;
            k--;
            z++;
            if(k==1 && n>1)
            {
                 a[z]=n;
                 for(int c=0;c<z;z=c++)
                 {
                  System.out.print(z+" ");
                  return;
                 }
            }
          }
     }

}
}


import java.util.Scanner;

public class Dulces {

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


/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

import com.sun.xml.internal.ws.api.pipe.NextAction;
import java.io.Console;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Scanner;

/**
 *
 * @author KID
 */
public class test {

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

        int n=sc.nextInt(),counter=0;
        int[] a1=new int[n];
        int[] a2=new int[n];
        for(int i = 0 ; i<n ; i++){
            a1[i]=sc.nextInt();
            a2[i]=sc.nextInt();

        }

        for(int i = 0 ; i<n ; i++){
            for(int k=0 ; k<n ; k++){
                if(a1[i]==a2[k]){
                    counter++;
                }
            }
        }
        System.out.println(counter);

     }
}


/*
 * Code Author: Akshay Miterani
 * DA-IICT
 */
import java.io.*;
import java.math.*;
import java.util.*;

public class Main {

	InputReader in;
	PrintWriter out;
	Main() throws IOException {
		in = new InputReader(System.in);
		out = new PrintWriter(System.out);
		//in = new InputReader(new FileInputStream("output_.txt"));
		//out = new PrintWriter(new File("output_.txt"));
		solve();
		out.close();
	}

	public static void main(String args[]) {
		new Thread(null, new Runnable() {
			public void run() {
				try {
					new Main();
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		}, "1", 1 << 26).start();
	}

	//--------------------My Code Starts Here----------------------
	int mod=(int)1e9+7;
	public void solve() throws IOException{
		long n=in.nextLong();
		long l=in.nextLong();
		long r=in.nextLong();
		long ans=0;
		for(long i=l;i<=r;i++){
			ans+=get(n, i);
		}
		System.out.println(ans);
	}
	//---------------------My Code Ends Here------------------------
	long get(long x, long ind){
		long size=0;
		long xx=x;
		while(xx>0){
			xx/=2;
			size++;
		}
		long cur=1L<<(size-1);
		if(ind==cur){
			return x%2;
		}
		else if(ind<cur){
			return get(x/2, ind);
		}
		else{
			return get(x/2, ind-cur);
		}
	}
	StringBuilder sb=new StringBuilder();
	StringBuilder rec(long x){
		StringBuilder sb=new StringBuilder();
		if(x<=1){
			sb.append(x);
			return sb;
		}
		else{
			StringBuilder tmp=rec(x/2);
			sb.append(tmp);
			sb.append(x%2);
			sb.append(tmp);
			return sb;
		}
	}
	static long modulo(long a,long b,long c) {
		long x=1;
		long y=a;
		while(b > 0){
			if(b%2 == 1){
				x=(x*y)%c;
			}
			y = (y*y)%c; // squaring the base
			b /= 2;
		}
		return  x%c;
	}

	static class Pair implements Comparable<Pair>{
		int x;
		int y;
		Pair(int xx,int yy){
			x=xx;
			y=yy;
		}
		@Override
		public int compareTo(Pair o) {
			if(Long.compare(this.x, o.x)!=0)
				return -Long.compare(this.x, o.x);
			else
				return Long.compare(this.y, o.y);
		}
	}
	public static void debug(Object... o) {
		System.out.println(Arrays.deepToString(o));
	}

	static final class InputReader{
		private final InputStream stream;
		private final byte[] buf=new byte[1024];
		private int curChar;
		private int numChars;
		public InputReader(InputStream stream){this.stream=stream;}
		private int read()throws IOException{
			if(curChar>=numChars){
				curChar=0;
				numChars=stream.read(buf);
				if(numChars<=0)
					return -1;
			}
			return buf[curChar++];
		}
		public final int nextInt()throws IOException{return (int)nextLong();}
		public final long nextLong()throws IOException{
			int c=read();
			while(isSpaceChar(c)){
				c=read();
				if(c==-1) throw new IOException();
			}
			boolean negative=false;
			if(c=='-'){
				negative=true;
				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 negative?(-res):(res);
		}
		public final int[] readIntBrray(int size)throws IOException{
			int[] arr=new int[size];
			for(int i=0;i<size;i++)arr[i]=nextInt();
			return arr;
		}
		public final String next()throws IOException{
			int c=read();
			while(isSpaceChar(c))c=read();
			StringBuilder res=new StringBuilder();
			do{
				res.append((char)c);
				c=read();
			}while(!isSpaceChar(c));
			return res.toString();
		}
		public final String nextLine()throws IOException{
			int c=read();
			while(isSpaceChar(c))c=read();
			StringBuilder res=new StringBuilder();
			do{
				res.append((char)c);
				c=read();
			}while(c!='\n'&&c!=-1);
			return res.toString();
		}
		private boolean isSpaceChar(int c){
			return c==' '||c=='\n'||c=='\r'||c=='\t'||c==-1;
		}
	}
}


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

public class line
{
	public static void main(String[] args) throws IOException {
		Scanner s = new Scanner(System.in);
		int n = s.nextLong();
		int m = s.nextLong();
		int k = s.nextLong();
		int left = k-1;
		int right = n-k;
		int tleft = 0;
		int tright = 0;
		m = m- n;
		int ans = 1;
		if(n==1){
		    ans += m;
		    m=0;
		}
		while(m>0){
			ans++;
			if(tleft<left) {
				tleft++;
			}
			if(tright<right) {
				tright++;
			}
			m = m-tleft-tright-1;
		}
		System.out.println(ans);
	}
}


import java.util.*;
public class Myclass {
     public static void main(String[] args) {
         BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
         int n = Integer.parseInt(br.readLine());
         while(n-- > 0){
           int x = Integer.parseInt(br.readLine());
           if(x < 3){
             System.out.println("NO");
           }
           else {
           while(x % 7 == 0){
             x /= 7;
           }
           while(x % 3 == 0){
             x /= 3;
           }
           if(x == 1)
              System.out.println("YES");
          else
              System.out.println("NO");
         }
       }
     }
}


package codeforce;

import java.util.Scanner;

public class Codeforce {

    public static void main(String[] args) {

        Scanner cin=new Scanner(System.in);
        int a[][];
        a=new int[5][5];
        for(int i=1;i<4;i++)
            for(int j=1;j<4;j++)
            {
                a[i][j]=cin.nextInt();
            }

        for(int i=1;i<4;i++)
        {
            for(int j=1;j<4;j++)
            {
                System.out.print((a[i][j]+a[i+1][j]+a[i][j+1]+a[i-1][j]+a[i][j-1]+1)%2);
            }
            System.out.println();
        }

}


import java.util.Scanner;

public class CodeForces2 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(); int arr[] = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = sc.nextInt();
        }
        Arrays.sort(arr);
        System.out.println(arr[0]);
    }
}


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

public class Display {

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

		BufferedReader f=new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(
						System.out)));
		StringTokenizer st=new StringTokenizer(f.readLine());

		int a=Integer.parseInt(st.nextToken());

		int diff = a;
		int b;
		int c;
		for (int j = 0; j < a / 2; j++) {
			for (int i = 0; i < a / 2; i++) {
				if (j * i == a) {
					if (Math.abs(i - j) < diff) {
						diff = Math.abs(i - j);
						b = j;
						c = i;
					}
				}
			}
		}
		System.out.print(b);
		System.out.print(c);
		System.out.close();
		}

}