public void inputAndReverse(char[] p_input) throws IOException {
        ArrayBasedStack<Integer> l_startStack = new ArrayBasedStack<>(10000);
        ArrayBasedStack<Integer> l_endStack = new ArrayBasedStack<>(10000);



        boolean l_flag = true;

        for (int l_i = 0; l_i < p_input.length; l_i++) {

            if (p_input[l_i] == ' ') {
                if (!l_flag) {
                    l_endStack.push(l_i - 1);
                    l_flag = true;
                }
            } else {
                if (l_flag) {
                    l_startStack.push(l_i);
                    l_flag = false;
                }
            }
        }

        l_endStack.push(p_input.length - 1);

        System.out.println("input is: " + Arrays.toString(p_input));

        while (l_startStack.size() > 0) {
            int l_start = l_startStack.pop();
            int l_end = l_endStack.pop();

            for (int l_i = l_start; l_i <= l_end; l_i++) {
                System.out.print(p_input[l_i]);
            }

            if (l_startStack.size() > 0)
                System.out.print(' ');
        }
    }