//import java.lang.reflect.*;
import java.io.*;
import java.net.*; // for datagram
public class Test_this {
static public void main( String[] args )throws IOException
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
//my name is mukherjee sanam
System.out.print("Type name: ");
String str ="";
System.out.print(str.toString());
str = br.readLine();
if((str !="") | (str != null)){
process_this pt = new process_this();
pt.method_parse(str);
} } }

class process_this {
public void method_parse(String str)throws IOException
{
String s = str;
byte[] b = s.getBytes();
DatagramPacket dp = new DatagramPacket(b, b.length);
//below is the clue to create server-client
//DatagramSocket socket = new DatagramSocket();
//socket.send(dp);
System.out.println(dp.toString());
String received = new String(dp.getData());
System.out.println("Received a datagram: " + received);

}
}