#include int main(){ int M,D; std::cin>>M>>D; if((M==4&&D==1))std::cout<<-1<