Please help me
package com.codegym.task.task08.task0823;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.text.*;
/*
Going national
*/
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String s = reader.readLine();
char esp = ' ';
char [] word = new char [s.length()];
for(int i = 0; i < s.length(); i++){
word[i] = s.charAt(i);
if(i == 0){
word[0] = Character.toUpperCase(s.charAt(0));
}
else if(s.charAt(i) == esp){
word[i+1] = Character.toUpperCase(s.charAt(i+1));
i=i+1;
}
}
for(char x : word){
System.out.print(x);
}
//
//write your code here
}
}