joioji.cpp: In function 'int main()':
joioji.cpp:16:25: warning: array subscript is above array bounds [-Warray-bounds]
sum[i][3] = sum[i-1][3]; if(s[i] == 'I') sum[i][3]++;
~~~~~~~~~~^
joioji.cpp:16:11: warning: array subscript is above array bounds [-Warray-bounds]
sum[i][3] = sum[i-1][3]; if(s[i] == 'I') sum[i][3]++;
~~~~~~~~^
joioji.cpp:16:52: warning: array subscript is above array bounds [-Warray-bounds]
sum[i][3] = sum[i-1][3]; if(s[i] == 'I') sum[i][3]++;
~~~~~~~~^
joioji.cpp:17:53: warning: array subscript is above array bounds [-Warray-bounds]
if(sum[i][1] == sum[i][2] && sum[i][2] == sum[i][3]){
~~~~~~~~^
joioji.cpp:22:29: warning: array subscript is above array bounds [-Warray-bounds]
haS = (haS*base + sum[i][3]-sum[i][2]) % mod;
~~~~~~~~^