#include #include using namespace std; int main(){ int n; cin >> n; string genes[n]; for(int genes_i = 0; genes_i < n; genes_i++){ cin >> genes[genes_i]; } int health[n]; for(int health_i = 0; health_i < n; health_i++){ cin >> health[health_i]; } int s; cin >> s; for(int a0 = 0; a0 < s; a0++){ int first; int last; string d; cin >> first >> last >> d; int i,j,k,x,sum=0;x=d.size(); for(i=first;i<=last;i++) { for(j=0;j