#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
freopen("strmatch.in", "r", stdin);
freopen("mihai.out", "w", stdout);
char *sir1, *sir2;
char *aux;
int nr;
int v[1000];
sir1 = (char *) malloc(2000000*sizeof(char));
sir2 = (char *) malloc(2000000*sizeof(char));
nr = 0;
scanf("%s\n%s", sir1, sir2);
aux = strstr(sir2, sir1);
if(aux != NULL)
{
nr = 1;
v[0] = strlen(sir2) - strlen(aux);
printf("%d ", v[0]);
}
while(aux != NULL)
{
aux++;
if(aux != NULL)
{
aux = strstr(aux, sir1);
if(aux != NULL)
{
v[nr] = strlen(sir2) - strlen(aux);
nr++;
printf("%d ", v[nr-1]);
}
}
}
fclose(stdout);
fclose(stdin);
FILE *fin;
fin = fopen("mihai.out", "r");
fgets(sir1, 2000000, fin);
char text[10];
sprintf(text, "%d", nr);
fclose(fin);
fin = fopen("strmatch.out", "w");
fprintf(fin, "%s\n", text);
fprintf(fin, "%s\n", sir1);
/*for(i=0;i<nr;i++)
{
printf("%d ", v[i]);
}*/
free(sir1);
free(sir2);
return 0;
}