while(0<1)println(180-((readLine split' '):\540)(_.toInt-_)%360)