<>=~'(.*)\s(.*)\s(.*)\s(.*)';print$1*$2%$4*$3%$4