#include #define rep(i,n) for(int i=0;i> A >> B >> C >> D; cout << (A * B * C) % D << endl; }