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 < x2) // x2 au lieu de x3
          mid = x1; // non--feasible
      }
    else
    if (x1 > x2)
      mid = x2;
    //else if (x1 > x3) 
    //  mid = x1;
    
    return(mid) ;
  }
}


