#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
const int INF = 1000 * 1000 * 1000;
void f(vector<int>& v)
{
vector<int> res = {-INF, INF};
for (auto& a : v)
{
if (a <= 0)
res[0] = max(res[0], a);
else
res[1] = min(res[1], a);
}
v = res;
}
int main()
{
int n;
cin >> n;
vector<vector<int>> v(3, vector<int>(n));
vector<int> d(n);
for (int i = 0; i < 3; i++) for (int j = 0; j < n; j++) cin >> v[i][j];
for (int i = 0; i < n; i++) cin >> d[i];
for (int i = 0; i < 3; i++) f(v[i]);
int ans = 2 * INF;
for (int i = 0; i < n; i++) ans = min(ans, abs(2 * d[i]));
for (int i = 0; i < 2; i++)
for (int j = 0; j < 2; j++)
for (int k = 0; k < 2; k++)
{
int l = 0, r = 0;
l = min({ v[0][i], v[1][j], v[2][k], 0 });
r = max({ v[0][i], v[1][j], v[2][k], 0 });
ans = min((long long)ans, 2ll * (abs(l) + r));
}
cout << ans << endl;
}