#include <iostream>
using namespace std;
const int N = 1E3 + 10;
int a[N];
int main(){
int n; cin >> n;
for(int i = 0; i < n; i ++ ) cin >> a[i];
int maxv = 0;
for(int i = 1; i < n; i ++ ) maxv = max(maxv, abs(a[i] - a[i - 1]));;
cout << maxv << endl;
return 0;
}