#include using namespace std; int a,b,c,d; main() { cin>>a>>b>>c>>d; cout<<(a==b&&c==d&&c