import io.StdIn._
import scala.collection.mutable

object Main extends App {

  val firstLine = readLine.split(" ").map(_.toInt)
  val N = firstLine(0)
  val M = firstLine(1)
  val K = firstLine(0)

  val nodePool = Range.inclusive(0, N).map(i => Node(0, mutable.Set.empty, mutable.Set.empty))

  for (_ <- 0 until M) {
    val friendship = readLine.split(" ").map(_.toInt)
    val smaller = friendship.min - 1
    val bigger = friendship.max - 1
    nodePool(smaller).friends.add(nodePool(bigger))
    nodePool(bigger).friends.add(nodePool(smaller))
  }
  for (_ <- 0 until K) {
    val blockship = readLine.split(" ").map(_.toInt)
    val smaller = blockship.min - 1
    val bigger = blockship.max - 1
    nodePool(smaller).blocks.add(nodePool(bigger))
    nodePool(bigger).blocks.add(nodePool(smaller))
  }


  var result = Array.fill[Int](N)(0)

  for (i <- 0 until N) {

    val set = mutable.Set.empty[Int]
    val node = nodePool(i)

    node.friends.foreach { f =>
      walk(node, f, set)
    }

    result.update(i, set.size)
  }

  result.foreach(r => print(s"$r "))
  print("\n")

  def walk(main: Node, next: Node, set: mutable.Set[Int]): Unit = {
    next.friends.foreach { f =>
      if (!set.contains(f.id) && !main.blocks.contains(f)) {
        set.add(f.id)
        walk(main, f, set)
      }
    }
  }
}

case class Node (
                  val id: Int,
                  val friends: mutable.Set[Node],
                  val blocks: mutable.Set[Node]
                )
