#include<bits/stdc++.h>
#define rep(i,x,y) for (int i=(x);i<=(y);i++)
#define ll long long
#define inf 1000000001
#define y1 y1___
using namespace std;
char gc(){
static char buf[],*p1=buf,*p2=buf;
return p1==p2&&(p2=(p1=buf)+fread(buf,,,stdin),p1==p2)?EOF:*p1++;
}
#define gc getchar
ll read(){
char ch=gc();ll x=;int op=;
for (;!isdigit(ch);ch=gc()) if (ch=='-') op=-;
for (;isdigit(ch);ch=gc()) x=(x<<)+(x<<)+ch-'';
return x*op;
}
#define N 60005
#define M 130005+N<<1
int n,m,cnt=,s_,t_,s,t,head[N],d[N],vis[N],cur[N];
struct edge{int to,nxt,c;}e[M];
void adde(int x,int y,int c){
e[++cnt].to=y;e[cnt].nxt=head[x];head[x]=cnt;
e[cnt].c=c;
}
void ins(int x,int y,int z){
adde(x,y,z);adde(y,x,);
}
bool bfs(){
queue<int> q;q.push(s);
rep (i,,t) vis[i]=-;vis[s]=;
while (!q.empty()){
int u=q.front();q.pop();
for (int i=head[u];i;i=e[i].nxt){
int v=e[i].to;
if (e[i].c&&vis[v]==-) vis[v]=vis[u]+,q.push(v);
}
}
return vis[t]!=-;
}
int dfs(int u,int flow){
if (u==t) return flow;
int w,used=;
for (int &i=cur[u];i;i=e[i].nxt){
int v=e[i].to;
if (e[i].c&&vis[v]==vis[u]+){
w=dfs(v,min(flow-used,e[i].c));
e[i].c-=w,e[i^].c+=w,used+=w;
if (used==flow) return used;
}
}
if (!used) vis[u]=-;
return used;
}
int dinic(){
int ret=;
while (bfs()){
memcpy(cur,head,sizeof(cur));//当前弧优化
ret+=dfs(s,inf);
}
return ret;
}
int main(){
n=read(),m=read(),s_=read(),t_=read();
rep (i,,m){
int x=read(),y=read(),a=read(),b=read();
ins(x,y,b-a);d[x]-=a,d[y]+=a;
}
s=n+,t=n+;
rep (i,,n) if (d[i]>) ins(s,i,d[i]);else ins(i,t,-d[i]);
dinic();//不加边直接跑,尽可能跑完
ins(t_,s_,inf);
dinic();//加边以后再跑
for (int i=head[s];i;i=e[i].nxt) if (vis[e[i].to]!=-) return puts("please go home to sleep"),;//判无解
printf("%d\n",e[cnt].c);
return ;
}