Infinity = 1e9

def Dijkstra(start, destination, n)
  m = @cost.size
  distance = Array.new(m){Array.new(1<<n, Infinity)}
  distance[start][(1<<n)-1] = 0.0
  visited = Array.new(m){Array.new(1<<n, nil)}
  q = Array.new.unshift([start, (1<<n)-1])
  until q.empty? do
    u, t = q.delete(q.min{|a, b| distance[a[0]][a[1]] <=> distance[b[0]][b[1]]})
    visited[u][t] = true
    next if t == 0
    for v in 0...m do
      next if u == v
      next unless @cost[u][v]
      for i in 0...n do
        next if t & (1<<i) == 0
        ticket = t ^ (1<<i)
        next if visited[v][ticket]
        cost = @cost[u][v] / @ticket[i]
        if distance[v][ticket] >= distance[u][t] + cost
          distance[v][ticket] = distance[u][t] + cost
          q.unshift([v, ticket])
        end
      end
    end
  end
  distance[destination].min
end

until (n,m,p,a,b=gets.split.map(&:to_i)).all?(&:zero?) do
  @cost = Array.new(m){Array.new(m, nil)}
  @ticket = gets.split.map(&:to_f)
  p.times do
    x, y, z = gets.split.map(&:to_i)
    x -= 1
    y -= 1
    @cost[x][y] = @cost[y][x] = z.to_f
  end
  answer = Dijkstra(a-1, b-1, n)
  puts answer == Infinity ? "Impossible" : answer
end