import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            String line = sc.nextLine();
            // 存储切分后的命令
            List<String> list = new ArrayList<>();
            splitCommand(line, list);
            System.out.println(list.size());
            for (String s : list) {
                System.out.println(s);
            }
        }
        sc.close();
    }

    private static void splitCommand(String line, List<String> list) {
        if (line.contains("\"")) {
            int i = line.indexOf("\"");
            String substring = line.substring(0, i);
            collect(substring, list);
            if (i + 1 < line.length()) {
                int j = i + 1;
                while (line.charAt(j) != '"') {
                    j++;
                }
                list.add(line.substring(i + 1, j));
                String nextSubStr = line.substring(j + 1);
                splitCommand(nextSubStr, list);
            }
        } else {
            collect(line, list);
        }
    }

    private static void collect(String str, List<String> list) {
        String[] split = str.split(" ");
        for (String s : split) {
            if (s != null && !s.equals("") && !s.equals(" ")) {
                list.add(s);
            }
        }
    }
}