import java.io._
import java.util.StringTokenizer
import scala.util.control.Breaks.{breakable,break}
import scala.collection.mutable.{Map, Stack, Queue, PriorityQueue, Set}

object Main extends App {
  val in = new InputReader(System.in)
  val pw = new PrintWriter(System.out)

  val N = in.next().toInt
  val tree = Array.fill[List[Int]](N+1)(Nil)
  for (_ <- 1 to N-1) {
    val a, b = in.next().toInt
    tree(a) = b :: tree(a)
    tree(b) = a :: tree(b)
  }

  //
  val MOD = 1e9.toInt + 7
  val root = 1

  val p = MOD

  // a / b
  def modDiv(a: Long, b: Long): Long = {

    // (x ^ n) % p
    def repeatSquares(x: Long, n: Int): Long = {
      def func(x: Long, n: Int): Long = {
        if(n == 0)
          1
        else if(n % 2 == 0)
          func(x*x % p, n/2)
        else
          (x * func(x*x % p, n/2)) % p
      }

      if (x == 0 && n != 0) 0
      else func(x, n)
    }

    val numer = a % p
    val denom = repeatSquares(b, p-2)

    (numer * denom) % p
  }


  val depthes = new Array[Int](N+1)
  val q = Queue[(Int, Int)](root -> 1)
  val memo = new Array[Boolean](N+1)
  while (!q.isEmpty) {
    val (now, depth) = q.dequeue()
    if (!memo(now)) {
      depthes(now) = depth
      memo(now) = true
      for (e <- tree(now))
        q.enqueue(e -> (depth+1))
    }
  }

  val subNum = new Array[Int](N+1) // i を根とする部分木の要素数
  val desc = depthes.zipWithIndex.drop(1).sorted.reverse

  desc.foreach { case (depth, i) =>
    subNum(i) += 1
    for (e <- tree(i) if depth-1 == depthes(e)) {
      subNum(e) += subNum(i)
    }
  }

  //
  val dp = new Array[Long](N+1)

  val mc = new ModComb(N, MOD)
  desc.foreach { case (depth, node) =>
    val children = tree(node).filter(e => depth+1 == depthes(e))

    val sum = children.map(subNum.apply).sum
    val (res, _) =
      children.foldLeft((1L, sum)){ case ((acc, n), e) =>
        val c = mc.comb(n, subNum(e))
        val hoge = (c * dp(e)) % MOD

        (acc * hoge) % MOD -> (n - subNum(e))
      }

    dp(node) = res
  }

  //println(dp.toList)

  pw.println(dp(1))
  for (node <- 2 to N) {
    val depth = depthes(node)
    val children = tree(node).filter(e => depth+1 == depthes(e))
    val sum = children.map(subNum.apply).sum

    val parent = tree(node).find(e => depth-1 == depthes(e)).get
    val parNum = N - subNum(node)

    val b = modDiv(modDiv(dp(parent), dp(node)), mc.comb(N-1, subNum(node)))
    val init = (mc.comb(N-1, parNum) * b) % MOD

    val (ans, _) =
      children.foldLeft((init, N-1 - parNum)) { case ((acc, n), e) =>
        val c = mc.comb(n, subNum(e))
        val hoge = (c * dp(e)) % MOD

        (acc * hoge) % MOD -> (n - subNum(e))
      }

    pw.println(ans)
  }
  pw.flush()
}

class ModComb(maxNum: Int, mod: Long) {

  private def repeatSquares(x: Long, n: Long): Long = {
    def func(x: Long, n: Long): Long = {
      if(n == 0)
        1
      else if(n % 2 == 0)
        func(x*x % mod, n/2)
      else
        (x * func(x*x % mod, n/2)) % mod
    }

    if (x == 0 && n != 0) 0
    else func(x, n)
  }

  private val fact = new Array[Long](maxNum + 1)

  fact(0) = 1
  for (i <- 1 to maxNum)
    fact(i) = (i * fact(i-1)) % mod

  private val factInv = new Array[Long](maxNum + 1)

  factInv(maxNum) = repeatSquares(fact(maxNum), mod-2)
  for (i <- (1 to maxNum).reverse)
    factInv(i-1) = (i * factInv(i)) % mod


  // nCk
  def comb(n: Int, k: Int): Long = {
    val numer = fact(n)
    val denom = (factInv(n-k) * factInv(k)) % mod

    (numer * denom) % mod
  }

}


object Sub {
  def print2DimArray[A](mat: Array[Array[A]]): Unit = {
    mat.foreach(lin => println(lin.toList))
  }
}

class InputReader(stream: InputStream) {
  private[this] val reader = new BufferedReader(new InputStreamReader(stream))
  private[this] var tokenizer: StringTokenizer = new StringTokenizer(reader.readLine())
  def next(): String = {
    while (!tokenizer.hasMoreTokens()) {
      tokenizer = new StringTokenizer(reader.readLine())
    }
    tokenizer.nextToken()
  }
}
