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]
			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]
		@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]
				swap(i, j)
				lift_down(j)
			end
		else
			l = (@array[j][1] < @array[k][1] ? j : k)
			if @array[i][1] > @array[l][1]
				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)
		reached = Set[s]
		queue = [s]
		depth = 0
		loop {
			break if max_depth && depth >= max_depth
			next_queue = []
			until queue.empty?
				u = queue.shift
				each_to_node_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, setting = {})
		raise "invalid setting" if setting.class != Hash
		raise "invalid setting" if setting.keys - [:goal, :multi_source, :multi_sink, :max_dist] != []


		
		start = Set[start] if !setting[:multi_source]
		goal = setting[:goal]
		goal = Set[goal] if goal && !setting[:multi_sink]
		max_dist = setting[:max_dist]

		h = Heap.new
		reached = Set.new
		start.each{|v|
			h.add(v, 0)
			reached << v
		}

		dist = {}
		until h.empty?
			u, key = h.del_min

			return key if setting[:goal] && goal.include?(u)
			break if max_dist && key > max_dist
			dist[u] = key
			each_to_node_of(u){|v|
				d = dist[u] + edge_length(u, v)
				if reached.include?(v)
					h.update_key(v, d)
				else
					h.add(v, d)
					reached << v
				end
			}
		end
		goal ? nil : dist
	end

	def bidir_dijkstra(s, t)
		f_dist = {}
		b_dist = {}

		f_heap = Heap.new
		b_heap = Heap.new

		f_heap.add(s, 0)
		b_heap.add(t, 0)

		f_reached = Set[s]
		b_reached = Set[t]

		f_current_dist = b_current_dist = 0
		best = Float::INFINITY

		loop {
			if !f_heap.empty?
				u, key = f_heap.del_min
				f_dist[u] = key
				f_current_dist = key
				each_to_node_of(u){|v|
					d = f_dist[u] + edge_length(u, v)
					if b_dist[v]
						path_len = d + b_dist[v]
						best = path_len if path_len < best
					end
					if f_reached.include?(v)
						f_heap.update_key(v, d)
					else
						f_heap.add(v, d)
						f_reached << v
					end
				}
			end

			if !b_heap.empty?
				u, key = b_heap.del_min
				b_dist[u] = key
				b_current_dist = key
				each_from_node_of(u){|v|
					d = b_dist[u] + edge_length(v, u)
					if f_dist[v]
						path_len = d + f_dist[v]
						best = path_len if path_len < best
					end
					if b_reached.include?(v)
						b_heap.update_key(v, d)
					else
						b_heap.add(v, d)
						b_reached << v
					end
				}
			end

			return best if f_current_dist + b_current_dist >= best
			return nil if f_heap.empty? && b_heap.empty?
		}
	end

	def prim(start)
		h = Heap.new
		h.add(start, 0)
		reached = Set[start]
		tree_len = 0

		until h.empty?
			u, key = h.del_min
			tree_len += key

			each_to_node_of(u){|v|
				d = edge_length(u, v)
				if reached.include?(v)
					h.update_key(v, d)
				else
					h.add(v, d)
					reached << v
				end
			}
		end
		tree_len
	end
end

class Graph
	include Graphical
	require 'set'

	def add_node(label = nil)
		Node.new(label)
	end

	def add_edge(u, v, label = nil)
		e = Edge.new(u, v, label)
		u.neighbour[v] = e
		v.neighbour[u] = e
		e
	end
	
	def del_edge(e)
		u, v = e.from, e.to
		u.neighbour.delete(v)
		v.neighbour.delete(u)
		e
	end

	class Node
		def initialize(label)
			@label = label
			@neighbour = {}
		end

		def to_s
			@label
		end
		
		attr_accessor :neighbour
		attr_reader :label
	end

	class Edge
		def initialize(u, v, label = nil)
			@from = u	
			@to = v
			@label = label
		end
		attr_reader :from, :to, :label
	end


	def each_to_node_of(u)
		u.neighbour.each_key{|v|
			yield v
		}
	end
	alias :each_from_node_of :each_to_node_of

	def edge_length(u, v)
		u.neighbour[v] ? 1 : nil
	end

end

class WeightedGraph < Graph
	def add_edge(u, v, length, label = nil)
		e = Edge.new(u, v, length, label)
		u.neighbour[v] = e
		v.neighbour[u] = e
		e
	end

	class Edge
		def initialize(u, v, length, label = nil)
			@from = u	
			@to = v
			@length = length
			@label = label
		end
		attr_reader :from, :to, :length, :label
	end

	def edge_length(u, v)
		u.neighbour[v].length
	end
end

extend Graphical
	def each_to_node_of(x)
		u, rest_tickets = x
		$g.each_to_node_of(u){|v|
			(0..rest_tickets.size-1).each{|i|
				copy = rest_tickets.dup
				copy.delete_at(i)
				yield [v, copy]
			}
		}
	end

	def edge_length(u, v)
		l = u[0].neighbour[v[0]].length
		raise "hoge" if u[1].size <= v[1].size
		(0..v[1].size-1).each{|i|
			return l / u[1][i] if u[1][i] != v[1][i]
		}
		l / u[1][-1]
	end

loop {
	t, n, m, a, b = gets.split.map &:to_i	
	break if t == 0

	$g = WeightedGraph.new
	nodes = (0..n).map{|i| $g.add_node(i) }
	tickets = gets.split.map(&:to_i).sort

	m.times{
		i, j, d = gets.split.map &:to_i
		$g.add_edge(nodes[i], nodes[j], d.to_f)
	}

	goals = (0..tickets.size).map{|k| tickets.combination(k).to_a}.flatten(1).uniq.map{|ts| [nodes[b], ts]}
	d = dijkstra([nodes[a], tickets], {:multi_sink => true, :goal => goals })
	if d
		printf("%.5f\n", d)
	else
		puts "Impossible"
	end
}

Measured memory_bytes: 6624