while true
n, m, r, a, b = gets.split(' ').map(&:to_i)

break if n + m + r + a + b == 0

t = gets.split(' ').map(&:to_i).sort
xyz = {}
(1..m).each{ |e| xyz[e] = {} }
r.times do
    x, y, z = gets.split(' ').map(&:to_i)
    xyz[x][y] = z.to_f
    xyz[y][x] = z.to_f
end

def find(rest, xyz, paths, answers, a, b)
    return if rest == 0
    nexts = xyz[a].keys
    nexts.each do |e|
        if e == b
            answers << (paths.dup << e)
        else
            find(rest-1, xyz, paths.dup << e, answers, e, b)
        end
    end
end

answers = []
find(n, xyz, [a], answers, a, b)


def values(path, xyz)
    ret = []
    (0..path.count-2).each do |index|
        ret << xyz[path[index]][path[index+1]]
    end
    return ret.sort
end

def min_val(xyz, path, t)
    values = values(path, xyz)
    ret = values.reduce(&:+)
    t.combination(path.count-1) do |t_arr|
        sum = 0
        values.each_with_index {|v, index| sum = sum + v/t_arr[index] }
        ret = [ret, sum].min
    end
    return ret
end
if answers.empty?
    puts 'Impossible'
else
    results = []
    answers.each {|ans| results << min_val(xyz, ans, t) }
    p results.min
end

end
