import java.util.Scanner;
public class Kyo
{
public static void main(String[] args)
{
Scanner scan = new Scanner(System.in);
char[][] css = new char[4][];
for(int i = 0; i < css.length; i++)
{
css[i] = scan.next().toCharArray();
}
scan.close();
System.out.println("\n你刚输入的诗句为:\n");
for(int i = 0; i < css.length; i++)
{
System.out.println(css[i]);
}
System.out.println("每句的第一个字和最后一个字:");
for(int i = 0; i < css.length; i++)
{
String first = new String(new char[]{ css[i][0] });
String last = new String(new char[]{ css[i][css[i].length - 1] });
System.out.println(first + ", " + last);
}
}
}