package com.codegym.task.task08.task0823; import java.io.*; import java.io.IOException; import java.io.InputStreamReader; import java.lang.*; import java.util.*; import java.util.stream.*; /* 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(); String[] array = s.split(" "); String result = "", last = ""; char first = '\0'; for(int i =0 ; i<array.length; i++) { String word = array[i]; String number = ""; if(Character.isDigit(word.charAt(0))) { number = word; } else { first = Character.toUpperCase(word.charAt(0)); last = ""; if(word.length() > 0) { last = word.substring(1, word.length()); } } result += i<array.length -1? (number.length() > 0? number + " " : (first + last + " ")) : (number.length() > 0? number : first + last); } System.out.print(result); } }