Problem:
X Cubic

Write a program which calculates the cube of a given integer x.

Input

An integer x is given in a line.

Output

Print the cube of x in a line.

Constraints

1 ≤ x ≤ 100

Sample Input 1

2

Sample Output 1

8

Sample Input 2

3

Sample Output 2

27

Solution in Scala (judge verdict: Accepted)

import scala.io.StdIn

object Main {
  def main(args:Array[String]) {
    val input = StdIn.readLine()
    val x = input.toInt
    println(pow(x, 3))
  }
  def pow(x:Int, y:Int) = {
    val list = List.fill(y)(x)
    list.reduceLeft{(x1, x2)=>x1*x2}
  }
}