while(1>0)println{val s=readLine;(2 min(s.tail.toInt-1)/15)+2*s(0)%43}