a,b,c=gets.split.map &:to_i a,b=[a,b].sort while c>0 if a