#include <iostream>
#include <algorithm>
#include <cstring>
#include <queue>
using namespace std;

int n;
int dist[101][101];
int atk[101][101];
int memo[101][101]; //memo[i][j] : ??????j??§?????????i???????????¨??????????°??\???\?????°
const int INF = 1000000000;

struct V{
  int p,m;
  V(int p,int m):p(p),m(m){}
};

bool operator < (const V& a,const V& b){
  return memo[a.p][a.m] > memo[b.p][b.m];
}

int solve(int s,int l){
  for(int i=0;i<=100;++i)
    for(int j=0;j<=100;++j)
      memo[i][j]=INF;
  memo[s][l] = 0;
  priority_queue<V> Q;
  Q.push(V(s,l));

  while(!Q.empty()){
    V x=Q.top(); Q.pop();
    int cur = x.p, mon = x.m, cst=memo[cur][mon];
    for(int i=0;i<n;++i){
      if(dist[cur][i]){
	if(cst+atk[cur][i] < memo[i][mon]){
	  memo[i][mon] = cst+atk[cur][i];
	  Q.push(V(i,mon));
	}
	if(mon-dist[cur][i]>=0){
	  if(memo[i][mon-dist[cur][i]] > cst){
	    memo[i][mon-dist[cur][i]] = cst;
	    Q.push(V(i,mon-dist[cur][i]));
	  }
	}
      }
    }
  }

  int ret = INF;
  for(int i=0;i<=l;++i) ret = min(ret, memo[n-1][i]);
  return ret;
}
int main(){
  int m,l;
  while(cin>>n>>m>>l,n||m||l){
    memset(dist,0,sizeof(dist));
    memset(atk,0,sizeof(atk));
    while(m--){
      int a,b,d,e;
      cin >> a >> b >> d >> e;
      a--;b--;
      dist[a][b] = dist[b][a] = d;
      atk[a][b] = atk[b][a] = e;
    }
    cout<<solve(0,l)<<endl;
  }
  return 0;
}