Mike is trying rock climbing but he is awful at it. 

There are n holds on the wall, i-th hold is at height ai off the ground. Besides, let the sequence ai increase, that is, ai < ai + 1 for all i from 1 to n - 1; we will call such sequence a track. Mike thinks that the track a1, ..., an has difficulty <image>. In other words, difficulty equals the maximum distance between two holds that are adjacent in height.

Today Mike decided to cover the track with holds hanging on heights a1, ..., an. To make the problem harder, Mike decided to remove one hold, that is, remove one element of the sequence (for example, if we take the sequence (1, 2, 3, 4, 5) and remove the third element from it, we obtain the sequence (1, 2, 4, 5)). However, as Mike is awful at climbing, he wants the final difficulty (i.e. the maximum difference of heights between adjacent holds after removing the hold) to be as small as possible among all possible options of removing a hold. The first and last holds must stay at their positions.

Help Mike determine the minimum difficulty of the track after removing one hold.

Input

The first line contains a single integer n (3 ≤ n ≤ 100) — the number of holds.

The next line contains n space-separated integers ai (1 ≤ ai ≤ 1000), where ai is the height where the hold number i hangs. The sequence ai is increasing (i.e. each element except for the first one is strictly larger than the previous one).

Output

Print a single number — the minimum difficulty of the track after removing a single hold.

Examples

Input

3
1 4 6


Output

5


Input

5
1 2 3 4 5


Output

2


Input

5
1 2 3 7 8


Output

4

Note

In the first sample you can remove only the second hold, then the sequence looks like (1, 6), the maximum difference of the neighboring elements equals 5.

In the second test after removing every hold the difficulty equals 2.

In the third test you can obtain sequences (1, 3, 7, 8), (1, 2, 7, 8), (1, 2, 3, 8), for which the difficulty is 4, 5 and 5, respectively. Thus, after removing the second element we obtain the optimal answer — 4.
import static java.lang.Math.*;

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

public class Solution {

  private static FastIO io;

  private static void solve() {
    int n = io.nextInt();
    int[] a = new int[n];
    int difficulty = 0;
    for (int i = 0; i < n; i++) {
      a[i] = io.nextInt();
      if (i > 0) {
        difficulty = Math.max(difficulty, a[i] - a[i - 1]);
      }
    }
    int min = Integer.MAX_VALUE, index = -1;
    for (int i = 2; i < n; i++) {
      int diff = a[i] - a[i - 2];
      if (diff < min) {
        index = i -1 ;
        min = diff;
      }
    }
    io.print(max(min, difficulty));
  }

  public static void main(String[] args) {
    io = new FastIO(System.in, System.out);
    solve();
    io.close();
  }

  /**
   * https://github.com/ISKU/FastIO-Java
   *
   * @author Minho Kim <minho.kim093@gmail.com>
   */
  private static class FastIO {

    public static final int DEFAULT_BUFFER_SIZE = 65536;
    public static final int DEFAULT_INTEGER_SIZE = 11;
    public static final int DEFAULT_LONG_SIZE = 20;
    public static final int DEFAULT_WORD_SIZE = 256;
    public static final int DEFAULT_LINE_SIZE = 8192;
    public static final int EOF = -1;

    private final InputStream in;
    private final OutputStream out;

    private byte[] inBuffer;
    private int nextIn, inLength;
    private byte[] outBuffer;
    private int nextOut;

    private char[] charBuffer;
    private byte[] byteBuffer;

    public FastIO(InputStream in, OutputStream out, int inBufferSize, int outBufferSize) {
      this.in = in;
      this.inBuffer = new byte[inBufferSize];
      this.nextIn = 0;
      this.inLength = 0;

      this.out = out;
      this.outBuffer = new byte[outBufferSize];
      this.nextOut = 0;

      this.charBuffer = new char[DEFAULT_LINE_SIZE];
      this.byteBuffer = new byte[DEFAULT_LONG_SIZE];
    }

    public FastIO(InputStream in, OutputStream out) {
      this(in, out, DEFAULT_BUFFER_SIZE, DEFAULT_BUFFER_SIZE);
    }

    public FastIO(InputStream in, OutputStream out, int bufferSize) {
      this(in, out, bufferSize, bufferSize);
    }

    public char nextChar() {
      byte b;
      while (isSpace(b = read())) {
        ;
      }

      return (char) b;
    }

    public String next() {
      byte b;
      while (isSpace(b = read())) {
        ;
      }

      int pos = 0;
      do {
        charBuffer[pos++] = (char) b;
        ensureCapacity(pos);
      } while (!isSpace(b = read()));

      return new String(charBuffer, 0, pos);
    }

    public String nextLine() {
      byte b;
      int pos = 0;

      while (!isLine(b = read())) {
        charBuffer[pos++] = (char) b;
        ensureCapacity(pos);
      }

      return new String(charBuffer, 0, pos);
    }

    public int nextInt() {
      byte b;
      while (isSpace(b = read())) {
        ;
      }

      boolean negative = false;
      int result = b - '0';
      if (b == '-') {
        negative = true;
        result = 0;
      }

      while (isDigit(b = read())) {
        result = (result * 10) + (b - '0');
      }

      return negative ? -result : result;
    }

    public long nextLong() {
      byte b;
      while (isSpace(b = read())) {
        ;
      }

      boolean negative = false;
      long result = b - '0';
      if (b == '-') {
        negative = true;
        result = 0;
      }

      while (isDigit(b = read())) {
        result = (result * 10) + (b - '0');
      }

      return negative ? -result : result;
    }

    public float nextFloat() {
      byte b;
      while (isSpace(b = read())) {
        ;
      }

      int pos = 0;
      do {
        charBuffer[pos++] = (char) b;
      } while (!isSpace(b = read()));

      return Float.parseFloat(new String(charBuffer, 0, pos));
    }

    public float nextFloat2() {
      byte b;
      while (isSpace(b = read())) {
        ;
      }

      boolean negative = false;
      float result = b - '0';
      if (b == '-') {
        negative = true;
        result = 0;
      }

      while (isDigit(b = read())) {
        result = (result * 10) + (b - '0');
      }

      float d = 1;
      if (b == '.') {
        while (isDigit(b = read())) {
          result += (b - '0') / (d *= 10);
        }
      }

      return negative ? -result : result;
    }

    public double nextDouble() {
      byte b;
      while (isSpace(b = read())) {
        ;
      }

      int pos = 0;
      do {
        charBuffer[pos++] = (char) b;
      } while (!isSpace(b = read()));

      return Double.parseDouble(new String(charBuffer, 0, pos));
    }

    public double nextDouble2() {
      byte b;
      while (isSpace(b = read())) {
        ;
      }

      boolean negative = false;
      double result = b - '0';
      if (b == '-') {
        negative = true;
        result = 0;
      }

      while (isDigit(b = read())) {
        result = (result * 10) + (b - '0');
      }

      double d = 1;
      if (b == '.') {
        while (isDigit(b = read())) {
          result += (b - '0') / (d *= 10);
        }
      }

      return negative ? -result : result;
    }

    public BigInteger nextBigInteger() {
      return new BigInteger(next());
    }

    public BigDecimal nextBigDecimal() {
      return new BigDecimal(next());
    }

    public char[] nextToCharArray() {
      byte b;
      while (isSpace(b = read())) {
        ;
      }

      int pos = 0;
      do {
        charBuffer[pos++] = (char) b;
        ensureCapacity(pos);
      } while (!isSpace(b = read()));

      char[] array = new char[pos];
      System.arraycopy(charBuffer, 0, array, 0, pos);
      return array;
    }

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

      return array;
    }

    public long[] nextLongArray(int size) {
      long[] array = new long[size];
      for (int i = 0; i < size; i++) {
        array[i] = nextLong();
      }

      return array;
    }

    public int[][] nextInt2DArray(int Y, int X) {
      int[][] array = new int[Y][X];
      for (int y = 0; y < Y; y++) {
        for (int x = 0; x < X; x++) {
          array[y][x] = nextInt();
        }
      }

      return array;
    }

    public void print(char c) {
      write((byte) c);
    }

    public void print(char[] chars) {
      print(chars, 0, chars.length);
    }

    public void print(char[] chars, int start) {
      print(chars, start, chars.length);
    }

    public void print(char[] chars, int start, int end) {
      for (int i = start; i < end; i++) {
        write((byte) chars[i]);
      }
    }

    public void print(String s) {
      for (int i = 0; i < s.length(); i++) {
        write((byte) s.charAt(i));
      }
    }

    public void print(int i) {
      if (i == 0) {
        write((byte) '0');
        return;
      }
      if (i == Integer.MIN_VALUE) {
        write((byte) '-');
        write((byte) '2');
        write((byte) '1');
        write((byte) '4');
        write((byte) '7');
        write((byte) '4');
        write((byte) '8');
        write((byte) '3');
        write((byte) '6');
        write((byte) '4');
        write((byte) '8');
        return;
      }

      if (i < 0) {
        write((byte) '-');
        i = -i;
      }

      int pos = 0;
      while (i > 0) {
        byteBuffer[pos++] = (byte) ((i % 10) + '0');
        i /= 10;
      }

      while (pos-- > 0) {
        write(byteBuffer[pos]);
      }
    }

    public void print(long l) {
      if (l == 0) {
        write((byte) '0');
        return;
      }
      if (l == Long.MIN_VALUE) {
        write((byte) '-');
        write((byte) '9');
        write((byte) '2');
        write((byte) '2');
        write((byte) '3');
        write((byte) '3');
        write((byte) '7');
        write((byte) '2');
        write((byte) '0');
        write((byte) '3');
        write((byte) '6');
        write((byte) '8');
        write((byte) '5');
        write((byte) '4');
        write((byte) '7');
        write((byte) '7');
        write((byte) '5');
        write((byte) '8');
        write((byte) '0');
        write((byte) '8');
        return;
      }

      if (l < 0) {
        write((byte) '-');
        l = -l;
      }

      int pos = 0;
      while (l > 0) {
        byteBuffer[pos++] = (byte) ((l % 10) + '0');
        l /= 10;
      }

      while (pos-- > 0) {
        write(byteBuffer[pos]);
      }
    }

    public void print(float f) {
      String sf = Float.toString(f);
      for (int i = 0; i < sf.length(); i++) {
        write((byte) sf.charAt(i));
      }
    }

    public void print(double d) {
      String sd = Double.toString(d);
      for (int i = 0; i < sd.length(); i++) {
        write((byte) sd.charAt(i));
      }
    }

    public void printls(char c) {
      print(c);
      write((byte) ' ');
    }

    public void printls(String s) {
      print(s);
      write((byte) ' ');
    }

    public void printls(int i) {
      print(i);
      write((byte) ' ');
    }

    public void printls(long l) {
      print(l);
      write((byte) ' ');
    }

    public void printls(float f) {
      print(f);
      write((byte) ' ');
    }

    public void printls(double d) {
      print(d);
      write((byte) ' ');
    }

    public void printls() {
      write((byte) ' ');
    }

    public void println(char c) {
      print(c);
      write((byte) '\n');
    }

    public void println(char[] chars) {
      print(chars, 0, chars.length);
      write((byte) '\n');
    }

    public void println(String s) {
      print(s);
      write((byte) '\n');
    }

    public void println(int i) {
      print(i);
      write((byte) '\n');
    }

    public void println(long l) {
      print(l);
      write((byte) '\n');
    }

    public void println(float f) {
      print(f);
      write((byte) '\n');
    }

    public void println(double d) {
      print(d);
      write((byte) '\n');
    }

    public void println() {
      write((byte) '\n');
    }

    public void printf(String format, Object... args) {
      String s = String.format(format, args);
      for (int i = 0; i < s.length(); i++) {
        write((byte) s.charAt(i));
      }
    }

    public void fprint(char c) {
      print(c);
      flushBuffer();
    }

    public void fprint(String s) {
      print(s);
      flushBuffer();
    }

    public void fprint(int i) {
      print(i);
      flushBuffer();
    }

    public void fprint(long l) {
      print(l);
      flushBuffer();
    }

    public void fprint(float f) {
      print(f);
      flushBuffer();
    }

    public void fprint(double d) {
      print(d);
      flushBuffer();
    }

    public void fprintf(String format, Object... args) {
      printf(format, args);
      flushBuffer();
    }

    private byte read() {
      if (nextIn >= inLength) {
        if ((inLength = fill()) == EOF) {
          return EOF;
        }
        nextIn = 0;
      }

      return inBuffer[nextIn++];
    }

    private void write(byte b) {
      if (nextOut >= outBuffer.length) {
        flushBuffer();
      }

      outBuffer[nextOut++] = b;
    }

    private int fill() {
      try {
        return in.read(inBuffer, 0, inBuffer.length);
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }

    public void flush() {
      flushBuffer();
    }

    private void flushBuffer() {
      if (nextOut == 0) {
        return;
      }

      try {
        out.write(outBuffer, 0, nextOut);
      } catch (Exception e) {
        throw new RuntimeException(e);
      }

      nextOut = 0;
    }

    public void close() {
      flush();
    }

    public void exit(char c) {
      fprint(c);
      System.exit(0);
    }

    public void exit(String s) {
      fprint(s);
      System.exit(0);
    }

    public void exit(int i) {
      fprint(i);
      System.exit(0);
    }

    public void exit(long l) {
      fprint(l);
      System.exit(0);
    }

    public void exit(float f) {
      fprint(f);
      System.exit(0);
    }

    public void exit(double d) {
      fprint(d);
      System.exit(0);
    }

    public void exit(String format, Object... args) {
      fprintf(format, args);
      System.exit(0);
    }

    public void exit() {
      flushBuffer();
      System.exit(0);
    }

    private void ensureCapacity(int size) {
      if (size < charBuffer.length) {
        return;
      }

      char[] array = new char[size * 2];
      System.arraycopy(charBuffer, 0, array, 0, size);
      charBuffer = array;
    }

    private boolean isDigit(byte b) {
      return b >= '0' && b <= '9';
    }

    private boolean isLine(byte b) {
      return b == '\n' || b == '\r' || b == EOF;
    }

    private boolean isSpace(byte b) {
      return b == ' ' || b == '\t' || b == '\n' || b == '\r' || b == '\f' || b == EOF;
    }
  }
}