Kazimierz Władysław Sapieha — military personnel, Polish–Lithuanian Commonwealth