func_code_string: #include <bits/stdc++.h>   using namespace std;   const int N = 5010;   const int mod = 1e9 + 7;   const long long INF = 1e15;   int nex[N];   long long x[N], a[N], b[N], c[N], d[N];   int main() {     int n, s, e;     while (~scanf( %d%d%d , &n, &s, &e)) {       nex[s] = e;       for (int i = 1; i <= n; i++) scanf( %I64d , &x[i]);       for (int i = 1; i <= n; i++) scanf( %I64d , &a[i]);       for (int i = 1; i <= n; i++) scanf( %I64d , &b[i]);       for (int i = 1l; i <= n; i++) scanf( %I64d , &c[i]);       for (int i = 1; i <= n; i++) scanf( %I64d , &d[i]);       for (int i = 1; i <= n; i++) {         if (i == s || i == e) continue;         long long mi = INF, id;         for (int j = s; j != e; j = nex[j]) {           long long tmpans = 0;           int from = j, to = i;           if (to < from)             tmpans += abs(x[from] - x[to]) + c[from] + b[to];           else             tmpans += abs(x[from] - x[to]) + d[from] + a[to];           from = i, to = nex[j];           if (to < from)             tmpans += abs(x[from] - x[to]) + c[from] + b[to];           else             tmpans += abs(x[from] - x[to]) + d[from] + a[to];           from = j, to = nex[j];           if (to < from)             tmpans -= abs(x[from] - x[to]) + c[from] + b[to];           else             tmpans -= abs(x[from] - x[to]) + d[from] + a[to];           if (mi > tmpans) {             mi = tmpans;             id = j;           }         }         int tmpnex = nex[id];         nex[id] = i;         nex[i] = tmpnex;       }       long long ans = 0;       for (int i = s; i != e; i = nex[i]) {         long long tmpans = 0;         int from = i, to = nex[i];         if (to < from)           tmpans += abs(x[from] - x[to]) + c[from] + b[to];         else           tmpans += abs(x[from] - x[to]) + d[from] + a[to];         ans += tmpans;       }       printf( %I64d n , ans);     }     return 0;   }   