let rec tak : int -> int -> int -> int =
    fun (x : int) (y : int) (z : int) ->
        if y >= x then
            z
        else
            tak (tak (x - 1) y z)
                (tak (y - 1) z x)
                (tak (z - 1) x y)
in

let run_benchmark : int -> int = fun _ : int ->
    let x : int = read_int () in
    let y : int = read_int () in
    let z : int = read_int () in
    print_int (tak x y z) ;
    0
in
time run_benchmark
