The angles of a quadrilateral measure x degrees, (x+30) degrees, (x+40) degrees and 170 degrees. What is the measure of the smallest angle?