#include #include #include #include #include #include #include int substring(char s1[], char s2[]){ if (strstr(s1, s2) != NULL) return 1; return 0; } int main(){ int n; scanf("%d",&n); char* *genes = malloc(sizeof(char*) * n); for(int genes_i = 0; genes_i < n; genes_i++){ genes[genes_i] = (char *)malloc(10240 * sizeof(char)); scanf("%s",genes[genes_i]); } int *health = malloc(sizeof(int) * n); for(int health_i = 0; health_i < n; health_i++){ scanf("%d",&health[health_i]); } int s; scanf("%d",&s); int min = 100000000; int max = 0; for(int a0 = 0; a0 < s; a0++){ int first; int last; char* d = (char *)malloc(512000 * sizeof(char)); scanf("%d %d %s",&first,&last,d); int minc = 0; int maxc = 0; int size = strlen(d); char c[size]; for(int i=0;imax) max=maxc; } printf("%d %d\n",min,max); return 0; }