#include<iostream>
#define INF 9999999
using namespace std;
char ch;
int MAP[21][21],mn,MN,a,b,c,d,n,m,w,x,y,z,v[21],u[21];
int compute(int start,int goal){
  for(int i=1;i<=n;i++)v[i]=u[i]=INF;
  v[start]=0;
  while(1){
    mn=INF;
    for(int i=1;i<=n;i++){
      if(v[i]<mn&&u[i]==INF){
	mn=v[i];
	MN=i;
      }
    }
    if(mn==INF)break;
    u[MN]=0;
    for(int i=1;i<=n;i++)if(MAP[MN][i]+v[MN]<v[i])v[i]=v[MN]+MAP[MN][i];
  }
  return v[goal]; 
}
int main(){
  cin>>n>>m;
  
  for(int i=1;i<=20;i++)for(int j=1;j<=20;j++)MAP[i][j]=INF;
  for(int i=1;i<=m;i++){
    cin>>a>>ch>>b>>ch>>c>>ch>>d;
    MAP[a][b]=c;
    MAP[b][a]=d;
  }
  cin>>w>>ch>>x>>ch>>y>>ch>>z;
  cout<<y-z-compute(w,x)-compute(x,w)<<endl;
  return 0;
}