import java.util.Scanner ;
public class $practice {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in) ;
String str = sc.nextLine () ;
int a = 0 ;
int count = 0 ;
for(int i = 0 ; i < str.length() ; i ++){
if(str.charAt(i) == ' '){
count ++ ;
}
}
System.out.println("count = : "+ count);
int [] arr = new int [count] ;
for(int i = 0 ; i < str.length() ; i ++) {
if(str.charAt(i) == ' '){
arr[a] = i ;
a++ ;
}
}
for(int j = 0 ; j < count ; j ++){
System.out.println(arr[j] + " ");
}
int e = arr[count - 1 ] ;
int s = arr[count - 2] + 1 ;
System.out.println(str.substring(s , e));
}
}