#include int main(void){ unsigned long num[4]; for (int i = 0; i < 4; i++){ scanf("%d",&num[i]); } printf("%d",(num[0] * num[1] * num[2] % num[3])); }