#include #include #include #include #include using namespace std; typedef unsigned long long ll; #define rep(i, n) for (int i=0;i < (int)(n);i++) int main(){ int n,m; ll mod; cin >> n >> m >> mod; char ope; int f=0; ll ans=0; cin >> ope; vector v(m); vector w(n); for (int i=0;i < m;i++) cin >> v[i]; for (int j=0;j > w[j]; if (ope=='+') f=0; else if (ope=='*') f=1; for (int i=0;i < n;i++){ for (int j=0;j