public class Median
{
  public static int f(Integer IV, Integer JV, Integer KV)
  {
      int x1 = IV.intValue();
      int x2 = JV.intValue();
      int x3 = KV.intValue();
    int mid = x3;
    if (x2 < x3)
      if (x1 < x2)
        mid = x2;
      else {
        if (x1 < x3)
          mid = x1;
      }
    else
    if (x1 > x2)
      mid = x2;
    else if (x1 > x3) 
      mid = x1;
    
    return(mid) ;
  }
}


