#include <iostream>
#include <cstdio>
#include <vector>
#include <queue>
#include <map>
#define MAX 1000000
using namespace std;

typedef pair<int,int> P;
struct edge{
    int to,cost; edge(){}
    edge(int to,int cost):to(to),cost(cost){}
};

int st,gl,mone,wood_mone,cnt = 0;
int n,m,costed[101];
vector< vector<edge> > info(101);

void init(){
    for(int i=0;i<101;i++) costed[i] = MAX;
}

void add_info(){
    int a,b,c,d;
    scanf("%d,%d,%d,%d",&a,&b,&c,&d);
    info[a].push_back(edge(b,c));
    info[b].push_back(edge(a,d));
}

int Dijkstra(){
    cnt++;
    priority_queue<P,vector<P>,greater<P> > que;
    if(cnt == 1){
        que.push(P(0,st));
        costed[st] = 0;
    }
    else if(cnt == 2){
        que.push(P(0,gl));
        costed[gl] = 0;
    }
    while(!que.empty()){
        P p = que.top(); que.pop();
        int now = p.second,c = p.first;
        if(now == st && cnt == 2) return c;
        else if(now == gl && cnt == 1) return c;
        for(int i=0;i<info[now].size();i++){
            edge e = info[now][i];
            if(e.cost + c < costed[e.to]){
                que.push(P(e.cost + c,e.to));
                costed[e.to] = e.cost + c;
            }
        }
    }
}

int main(){
    init();
    cin >> n >> m;
    for(int i=0;i<m;i++) add_info();
    scanf("%d,%d,%d,%d",&st,&gl,&mone,&wood_mone);
    int d = Dijkstra() + wood_mone;
    init();
    cout << mone - (Dijkstra() + d) << endl;
}