#include <stdio.h>
#include <stdlib.h>

#define MAXSIZE 500000

long n, k, auah, buah, i, x, y;

typedef struct {
    long source;
    long destination;
} pair;

pair v[2 * MAXSIZE];
long sol[MAXSIZE], next[MAXSIZE], nextlen = 0;

void init() {
    long i;

    for (i = 0; i < n; i++)
        sol[i] = buah;
}

void swap(long *x, long *y) {
    long t = *x;

    *x = *y;
    *y = t;
}

long partition( pair a[], long l, long r) {
   long pivot, i, j;
   pair t;
   pivot = a[l].source;
   i = l; j = r+1;

   while( 1)
   {
   	do ++i; while( a[i].source <= pivot && i <= r );
   	do --j; while( a[j].source > pivot );
   	if( i >= j ) break;
   	t = a[i]; a[i] = a[j]; a[j] = t;
   }
   t = a[l]; a[l] = a[j]; a[j] = t;
   return j;
}

void quickSort( pair a[], long l, long r)
{
   long j;

   if( l < r )
   {
   	// divide and conquer
        j = partition( a, l, r);
       quickSort( a, l, j-1);
       quickSort( a, j+1, r);
   }

}

long getPos(long x, long i, long j) {
    if (i == j)
        return i;
    long p = (i + j) / 2;

    if (v[p].source < x)
        return  getPos(x, p+1, j);
    else
        return getPos(x, i, p);
}

int main()
{
    pair d;
    long pos;

    scanf("%ld%ld%ld%ld", &n, &k, &auah, &buah);

    init();
    for (i = 0; i < k; i++) {
        scanf("%ld%ld", &x, &y);
        if (x > y)
            swap(&x, &y);
        d.source = x-1;
        d.destination = y-1;
        v[2*i] = d;
        d.source = y-1;
        d.destination = x-1;
        v[2*i+1] = d;
    }

    quickSort(v, 0, 2*k-1);

    sol[0] = 0;
    next[nextlen++] = 0;
    for (i = 0; i < nextlen; i++) {
        if (i == buah / auah)
            break;
        pos = getPos(next[i], 0, 2*k-1);
        while (v[pos].source == next[i]) {
            if (sol[v[pos].source] + auah < sol[v[pos].destination]) {
                sol[v[pos].destination] = sol[v[pos].source] + auah;
                next[nextlen++] = v[pos].destination;
                if (v[pos].destination == n-1)
                    break;
            }
            pos++;
        }
    }

    printf("%ld\n", sol[n-1]);
    return 0;
}