n, m = gets.split.map(&:to_i)
ab = []
m.times do
  ab.push gets.split.map(&:to_i)
end
$h = Hash.new([])
ab.each do |bridge|
  $h[bridge.first] += [bridge.last]
  $h[bridge.last] += [bridge.first]
end
def calc(hash)
  hash.each do |a, b|
    b.each do |e|
    end
  end
  []
end

def linked(a, b, checked)
  l = [a]
    b.each do |dest|
      next if checked.include?(dest)
      l.push dest
      l.push linked(dest, $h[dest], checked + [a])
    end
    l.flatten
end
ab.each do |bridge|
  group = []
  $h[bridge.first] -= [bridge.last]
  $h[bridge.last] -= [bridge.first]
  $h.each do |src, dests|
    islands = linked(src, dests, []).uniq.sort
    group.push islands
  end
  f = group.uniq.combination(2).to_a.map { |e| e.first.size * e.last.size }.reduce(:+)
  if f
    puts f
  else
    puts 0
  end
end
