List<Character> collect = Arrays.stream(scanner.nextLine().split(" ")) .map(a -> new a.charAt(0)).collect(Collectors.toList());