object Main extends App {
  import scala.io.StdIn.readLine
  val Array(a, b, c) = readLine().split(' ').map(_.toInt)
  val Array(k) = readLine().split(' ').map(_.toInt)

  (0 to k).foldLeft((a,b,c)) { case ((a,b,c), _ ) =>
    val maximumIdx = Seq(a,b,c).zipWithIndex.maxBy(_._1)._2
    maximumIdx match {
      case 0 =>
        (a * 2, b, c)
      case 1 =>
        (a, b * 2, c)
      case 2 =>
        (a, b, c * 2)
    }
  }
}
