#include int main(){ int i; for(i=0;i<32;i++){ char s[5]; scanf("%s",s); if(s[1]-s[0]==1||s[2]-s[1]==1)puts("1"); else puts("0"); } return 0; }