package main
import (
  "bufio"
  "os"
  "strconv"
  "strings"
  "fmt"
)

var reader = bufio.NewReaderSize(os.Stdin, 1000000)
var writer = bufio.NewWriter(os.Stdout)
func NextLine() string {
  buffer := make([]byte, 0)
  for true {
    line, isPrefix, err := reader.ReadLine()
    if err != nil { panic(err) }
    buffer = append(buffer, line...)
    if !isPrefix { break }
  }
  return string(buffer)
}
func NextInt(A ...*int) {
  L := strings.Split(NextLine(), " ")
  for i, a := range A {
    *a, _ = strconv.Atoi(L[i])
  }
}
func NextIntVec(A *[]int) {
  L := strings.Split(NextLine(), " ")
  (*A) = make([]int, len(L))
  for i, l := range L {
    (*A)[i], _ = strconv.Atoi(l)
  }
}
func NextFloat(A ...*float64) {
  L := strings.Split(NextLine(), " ")
  for i, a := range A {
    *a, _ = strconv.ParseFloat(L[i], 64)
  }
}
func NextFloatVec(A *[]float64) {
  L := strings.Split(NextLine(), " ")
  (*A) = make([]float64, len(L))
  for i, l := range L {
    (*A)[i], _ = strconv.ParseFloat(l, 64)
  }
}
func Write(s interface{}) {
  fmt.Fprintln(writer, s)
}
func WriteIntVec(A []int) {
  S := make([]string, len(A))
  for i, a := range A {
    S[i] = strconv.Itoa(a)
  }
  Write(strings.Join(S, " "))
}
func Output() {
  _ = writer.Flush()
}

func MaxInt(A ...int) int {
  max := A[0]
  for _, a := range A {
    if max < a { max = a }
  }
  return max
}
func MinInt(A ...int) int {
  min := A[0]
  for _, a := range A {
    if a < min { min = a }
  }
  return min
}
func SumInt(A ...int) int {
  sum := 0
  for _, a := range A {
    sum += a
  }
  return sum
}
func AbsInt(x int) int {
  if x < 0 { x = -x }
  return x
}

func Factorial(N int) (F, Finv, Inv []int) {
  F = make([]int, N + 1)
  Finv = make([]int, N + 1)
  Inv = make([]int, N + 1)
  F[0] = 1
  F[1] = 1
  Finv[0] = 1
  Finv[1] = 1
  Inv[0] = 1
  Inv[1] = 1
  for i := 2; i < N + 1; i++ {
    F[i] = F[i - 1] * i % p
    Inv[i] = p - Inv[p % i] * (p / i) % p
    Finv[i] = Finv[i - 1] * Inv[i] % p
  }
  return
}

func Inverse(N int) int {
  if N < 2 { return 1 }
  return p - Inverse(p % N) * (p / N) % p
}

func Comb(F, Finv *[]int, A ...int) int {
  S := SumInt(A...)
  C := (*F)[S]
  for _, a := range A {
    C *= (*Finv)[a]
    C %= p
  }
  return C
}

const p = 1000000007

func Solve(){
  var N int
  NextInt(&N)
  T := make([][]int, N)
  for i := range T {
    T[i] = make([]int, 0)
  }
  var a, b int
  for i := 1; i < N; i++ {
    NextInt(&a, &b)
    a, b = a - 1, b - 1
    T[a] = append(T[a], b)
    T[b] = append(T[b], a)
  }
  Q := make([]int, N)
  P := make([]int, N)
  for i := range P {
    P[i] = -1
  }
  pos := 1
  for _, q := range Q {
    for _, adj := range T[q] {
      if P[q] == adj { continue }
      P[adj] = q
      Q[pos] = adj
      pos++
    }
  }
  F, Finv, _ := Factorial(N)
  A := make([]int, N)
  V := make([]int, N)
  for i := range A {
    A[i] = 1
  }
  for i := range V {
    V[i] = 1
  }
  for i := N - 1; 0 <= i; i-- {
    q := Q[i]
    for _, v := range T[q] {
      if P[q] == v { continue }
      V[q] += V[v]
      A[q] *= A[v] * Finv[V[v]] % p
      A[q] %= p
    }
    A[q] *= F[V[q] - 1]
    A[q] %= p
  }
  for _, q := range Q {
    for _, v := range T[q] {
      if P[q] == v { continue }
      A[v] = A[q] * V[v] % p * Inverse(N - V[v]) % p
    }
  }
  for _, a := range A {
    Write(a)
  }
}

func main() {
  Solve()
  Output()
}

Measured memory_bytes: 31744