//: Playground - noun: a place where people can play

import UIKit
import Foundation
func readInt(str : String) -> Int{
    return Int(str)  ?? 0
}

func splitInt(str : String,array :inout [Int]) ->(){
    var temp : String = ""
    for itr in str{
        if itr == " "{
            array.append(Int(temp) ?? 0)
            print(temp)
            temp =  ""
        } else {
            temp += String(itr)
        }
    }
    array.append(Int(temp) ?? 0)
}

var str :String!
str = readLine() ?? ""

var vec : [Int] = [10000]

splitInt(str:str, array: &vec)

var a:Int
var b:Int
var c:Int

a = vec[0]
b = vec[1]
c = vec[2]

if abs(a-b) > abs(a-c){
    print(c)
} else {
    print(b)
}
