Mr. Bender has a digital table of size n × n, each cell can be switched on or off. He wants the field to have at least c switched on squares. When this condition is fulfilled, Mr Bender will be happy.

We'll consider the table rows numbered from top to bottom from 1 to n, and the columns — numbered from left to right from 1 to n. Initially there is exactly one switched on cell with coordinates (x, y) (x is the row number, y is the column number), and all other cells are switched off. Then each second we switch on the cells that are off but have the side-adjacent cells that are on.

For a cell with coordinates (x, y) the side-adjacent cells are cells with coordinates (x - 1, y), (x + 1, y), (x, y - 1), (x, y + 1).

In how many seconds will Mr. Bender get happy?

Input

The first line contains four space-separated integers n, x, y, c (1 ≤ n, c ≤ 109; 1 ≤ x, y ≤ n; c ≤ n2).

Output

In a single line print a single integer — the answer to the problem.

Examples

Input

6 4 3 1


Output

0


Input

9 3 8 10


Output

2

Note

Initially the first test has one painted cell, so the answer is 0. In the second test all events will go as is shown on the figure. <image>.
import java.util.*;
import java.io.*;
public class Bender {

	static Scanner seer = new Scanner(System.in);
	
	static int N;
	static int Y;
	static int X;
	static int T;
	
	public static void main(String[] args) {
		N = seer.nextInt();
		Y = seer.nextInt();
		X = seer.nextInt();
		T = seer.nextInt();
		
		System.out.println(search());
	}
	
	/**
	 * Min t to T;
	 * @return
	 */
	public static int search(){
		int testing = 0;
		//boolean found = false;
		//int dif = T;
		while(true){ //if(testing%100==0) System.out.println("test: "+testing + " black: "+black(testing));
			if(black(testing) >= T){
				break;
			}
			testing++;
		}
		/*
		while(!found){											System.out.println("test: "+testing + " black: "+black(testing));
			if(black(testing) >= T && black(testing-1) < T){
				found = true;
			}
			else if(black(testing) > T){
				testing -= dif;
			}
			else{
				testing += dif;
			}
			if(dif > 1)
				dif /=2;
		}
		*/
		return testing;
	}
	
	public static long black(long t){
		if(t < 0) return -1;
		
		long b = 2*t*(t+1)+1; //if(t%100==0) System.out.println("              b: "+b);
		
		int west = X - 1;
		int east = N - X;
		int north = Y - 1;
		int south = N - Y;
		
		long des_w = (t - west > 0)? (t - west)*(t - west) : 0; //System.out.println("              des_w: "+des_w);
		long des_e = (t - east > 0)? (t - east)*(t - east) : 0; //System.out.println("              des_e: "+des_e);
		long des_n = (t - north > 0)? (t - north)*(t - north) : 0; //System.out.println("              des_n: "+des_n);
		long des_s = (t - south > 0)? (t - south)*(t - south) : 0; //System.out.println("              des_s: "+des_s);
		
		long t_sw = t - west - south;
		long t_nw = t - west - north;
		long t_se = t - east - south;
		long t_ne = t - east - north;
		
		long con_sw = (t_sw > 0)? (t_sw - 1)*t_sw/2 : 0;
		long con_nw = (t_nw > 0)? (t_nw - 1)*t_nw/2 : 0;
		long con_se = (t_se > 0)? (t_se - 1)*t_se/2 : 0;
		long con_ne = (t_ne > 0)? (t_ne - 1)*t_ne/2 : 0;
		
		return b - des_w - des_e - des_n - des_s
					+ con_sw + con_nw + con_se + con_ne;
	}

}
