class Heap
    require 'forwardable'
    extend Forwardable

    def initialize
        @array = []
        @index = {}
    end

    def add(obj, key)
        @array << [obj, key]
        @index[obj] = @array.size - 1
        lift_up(@array.size - 1)
    end

    def swap(i, j)
        u = @array[i]
        v = @array[j]
        @index[u[0]], @index[v[0]] = j, i
        @array[i], @array[j] = v, u
    end

    def lift_up(i)
        return if i == 0
        j = (i - 1) / 2
        if (@array[i][1] <=> @array[j][1]) < 0
            swap(i, j)
            lift_up(j)
        end
    end

    def del_min
        raise "heap is empty!" if empty?
        min = @array[0]
        if size > 1
            swap(0, @array.size-1)
            @array.pop
            lift_down(0)
        else
            @array.pop
        end
        @index.delete(min[0])
        min
    end

    def inc_key(obj, diff)
        i = @index[obj]
        @array[i][1] += diff
        lift_down(i)
    end

    def dec_key(obj, diff)
        i = @index[obj]
        @array[i][1] -= diff
        lift_up(i)
    end

    def update_key(obj, new_key)
        i = @index[obj]
        return unless i
        return if (new_key <=> @array[i][1]) >= 0
        @array[i][1] = new_key
        lift_up(i)
    end

    def min_obj
        @array[0][0]
    end

    def min_key
        @array[0][1]
    end

    def lift_down(i)
        j = 2 * i + 1
        k = j + 1
        if k >= size
            return if j >= size
            if (@array[i][1] <=> @array[j][1]) > 0
                swap(i, j)
                lift_down(j)
            end
        else
            l = ((@array[j][1] <=> @array[k][1]) < 0 ? j : k)
            if (@array[i][1] <=> @array[l][1]) > 0
                swap(i, l)
                lift_down(l)
            end
        end
    end

    def_delegators :@array, :empty?, :size
end

module Graphical
    require 'set'

    def reachable_from(s, max_depth = nil)
        queue = s.to_a
        reached = Set[*queue]
        depth = 0
        loop {
            break if max_depth && depth >= max_depth
            next_queue = []
            until queue.empty?
                u = queue.shift
                each_out_connection_of(u){|v, _|
                    next if reached.include?(v)
                    reached << v
                    next_queue << v
                }
            end
            break if next_queue.empty?
            queue = next_queue
            depth += 1
        }
        return reached
    end

    def dijkstra(start)
        raise "start must be Enumerable" if !start.kind_of?(Enumerable)
        h = Heap.new
        reached = Set[*start.to_a]
        start.each{|s| h.add(s, 0)}

        dist = {}
        until h.empty?
            u, key = h.del_min
            return key if block_given? && yield(u, key)
            dist[u] = key
            each_out_connection_of(u){|v, l|
                d = dist[u] + l
                if reached.include?(v)
                    h.update_key(v, d)
                else
                    h.add(v, d)
                    reached << v
                end
            }
        end
        block_given? ? nil : dist
    end
end

class Graph
    include Graphical

    def initialize(*options)
        @options = Set[*options]
    end

    def add_node(property = {})
        Node.new(property)
    end

    def add_edge(u, v, property = {})
        e = Edge.new(u, v, property)
        u.add_edge(e)
        v.add_edge(e)
        e
    end

    def del_edge(e)
        u, v = e.opposite.keys
        u.del_edge(e)
        v.del_edge(e)
        e
    end

    class Node
        def initialize(property)
            @property = property
            @edges = Set.new
        end

        def add_edge(e)
            @edges << e
        end

        def del_edge(e)
            @edges.delete(e)
        end

        def to_s
            @property[:name] || super
        end

        def each_edge
            @edges.each{|e|
                yield e
            }
        end

        attr_reader :property
    end

    class Edge
        def initialize(u, v, property)
            @opposite = {u => v, v => u}
            @property = property
        end
        attr_reader :opposite, :property

        def to_s
            @property[:name] || super
        end

        def length
            @property[:length] || 1
        end

        def actual_capacity(from)
            v = @opposite[from]
            cap = @property[:capacity]
            flow = (@property[:flow] ||= 0)
            to = (@property[:flow_to] ||= v)
            to == v ? cap - flow : cap + flow
        end
    end

    def each_out_connection_of(u)
        u.each_edge{|e|
            yield(e.opposite[u], e.length)
        }
    end

    alias :each_in_connection_of :each_out_connection_of
end

class Digraph < Graph
    def add_node(property = {})
        Node.new(property)
    end

    def add_edge(u, v, property = {})
        e = Edge.new(u, v, property)
        u.add_out_edge(e)
        v.add_in_edge(e)
        e
    end

    def del_edge(e)
        u, v = e.from, e.to
        u.out_edges.delete(e)
        v.in_edges.delete(e)
        e
    end

    class Node < Graph::Node
        def initialize(property)
            @property = property
            @out_edges = Set.new
            @in_edges = Set.new
        end

        def add_out_edge(e)
            @out_edges << e
        end

        def del_out_edge(e)
            @out_edges.delete(e)
        end

        def add_in_edge(e)
            @in_edges << e
        end

        def del_in_edge(e)
            @in_edges.delete(e)
        end

        attr_reader :in_edges, :out_edges
    end

    class Edge < Graph::Edge
        def initialize(u, v, property)
            @from = u
            @to = v
            @property = property
        end

        attr_reader :from, :to
    end

    def each_out_connection_of(u)
        u.out_edges.each{|e|
            yield [e.to, e.length]
        }
    end

    def each_in_connection_of(v)
        v.in_edges.each{|e|
            yield [e.from, e.length]
        }
    end
end

n, m, k, s = gets.split.map(&:to_i)
safe_fee, danger_fee = gets.split.map(&:to_i)
g = Digraph.new
nodes = (0..n).map { g.add_node }
z = Set[*(1..k).map { gets.to_i }]
edges = []
m.times do
    i, j = gets.split.map(&:to_i)
    edges << g.add_edge(nodes[i], nodes[j])
    edges << g.add_edge(nodes[j], nodes[i])
end
zombie_nodes = Set[*z.map {|i| nodes[i]}]
danger_nodes = g.reachable_from(zombie_nodes, s)
edges.each do |e|
    if zombie_nodes.include?(e.to)
        e.property[:length] = Float::INFINITY
    elsif e.to == nodes[n]
        e.property[:length] = 0
    elsif danger_nodes.include?(e.to)
        e.property[:length] = danger_fee
    else
        e.property[:length] = safe_fee
    end
end
p g.dijkstra([nodes[1]]){|v| v == nodes[n]}



Measured memory_bytes: 222452