import java.io.*;
public class ASCII_convertor
{
private static final char[] HexChars = {
'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
};
public static void main( String args[] )
throws Exception
{
File fin = new File("./input.txt");
File fout = new File("./output.txt");
BufferedReader r = new BufferedReader (new InputStreamReader (new FileInputStream(fin)) );
OutputStreamWriter w = new OutputStreamWriter( new FileOutputStream(fout) );
PrintWriter pw = new PrintWriter( w, true );
String line = r.readLine();
while (line != null )
{
String hexLine = toHexString(line.getBytes("UTF-8"));
pw.println( hexLine );
System.out.println( hexLine );
line = r.readLine();
}
r.close();
pw.close();
} // main
public static final String toHexString(byte[] bytes) {
StringBuffer sb = new StringBuffer();
for (int i=0; i < bytes.length; i++) {
sb.append(HexChars[(bytes >> 4) & 0xf]);
sb.append(HexChars[bytes & 0xf]);
sb.append(" ");
}
return new String(sb);
}
}