/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import java.util.*;
/**
*
* @author kajanek6
*/
public class Fs {
public static char compare
(String[] pismena,
String input,
int a,
int b
) {
int i=0;
while(i<b)
{
temp=temp+input.charAt(a+i);
i++;
}
if (temp.equals(pismena[0])) {
return 'A';
}
if (temp.equals(pismena[1])) {
return 'B';
}
if (temp.equals(pismena[2])) {
return 'C';
}
if (temp.equals(pismena[3])) {
return 'D';
}
if (temp.equals(pismena[4])) {
return 'E';
}
if (temp.equals(pismena[5])) {
return 'F';
}
if (temp.equals(pismena[6])) {
return 'G';
}
if (temp.equals(pismena[7])) {
return 'H';
}
if (temp.equals(pismena[8])) {
return 'I';
}
if (temp.equals(pismena[9])) {
return 'J';
}
if (temp.equals(pismena[10])) {
return 'K';
}
if (temp.equals(pismena[11])) {
return 'L';
}
if (temp.equals(pismena[12])) {
return 'M';
}
if (temp.equals(pismena[13])) {
return 'N';
}
if (temp.equals(pismena[14])) {
return 'O';
}
if (temp.equals(pismena[15])) {
return 'P';
}
if (temp.equals(pismena[16])) {
return 'Q';
}
if (temp.equals(pismena[17])) {
return 'R';
}
if (temp.equals(pismena[18])) {
return 'S';
}
if (temp.equals(pismena[19])) {
return 'T';
}
if (temp.equals(pismena[20])) {
return 'U';
}
if (temp.equals(pismena[21])) {
return 'V';
}
if (temp.equals(pismena[22])) {
return 'W';
}
if (temp.equals(pismena[23])) {
return 'X';
}
if (temp.equals(pismena[24])) {
return 'Y';
}
if (temp.equals(pismena[25])) {
return 'Z';
}
if (temp.equals(pismena[26])) {
return '_';
}
if (temp.equals(pismena[27])) {
return ',';
}
if (temp.equals(pismena[28])) {
return '.';
}
if (temp.equals(pismena[29])) {
return '?';
}
return 0;
}
public static void main
(String[] args
) { array[0] = ".-";
array[1] = "-...";
array[2] = "-.-.";
array[3] = "-..";
array[4] = ".";
array[5] = "..-.";
array[6] = "--.";
array[7] = "....";
array[8] = "..";
array[9] = ".---";
array[10] = "-.-";
array[11] = ".-..";
array[12] = "--";
array[13] = "-.";
array[14] = "---";
array[15] = ".--.";
array[16] = "--.-";
array[17] = ".-.";
array[18] = "...";
array[19] = "-";
array[20] = "..-";
array[21] = "...-";
array[22] = ".--";
array[23] = "-..-";
array[24] = "-.--";
array[25] = "--..";
array[26] = "..--";
array[27] = ".-.-";
array[28] = "---.";
array[29] = "----";
Scanner input
= new Scanner
(System.
in); while (input.hasNextLine()) {
String temp
= input.
nextLine(); int[] numbers = new int[temp.length()];
int i = 0;
while (i < temp.length()) {
if (temp.charAt(i) == 'A') {
process = process + array[0];
numbers[i] = array[0].length();
}
if (temp.charAt(i) == 'B') {
process = process + array[1];
numbers[i] = array[1].length();
}
if (temp.charAt(i) == 'C') {
process = process + array[2];
numbers[i] = array[2].length();
}
if (temp.charAt(i) == 'D') {
process = process + array[3];
numbers[i] = array[3].length();
}
if (temp.charAt(i) == 'E') {
process = process + array[4];
numbers[i] = array[4].length();
}
if (temp.charAt(i) == 'F') {
process = process + array[5];
numbers[i] = array[5].length();
}
if (temp.charAt(i) == 'G') {
process = process + array[6];
numbers[i] = array[6].length();
}
if (temp.charAt(i) == 'H') {
process = process + array[7];
numbers[i] = array[7].length();
}
if (temp.charAt(i) == 'I') {
process = process + array[8];
numbers[i] = array[8].length();
}
if (temp.charAt(i) == 'J') {
process = process + array[9];
numbers[i] = array[9].length();
}
if (temp.charAt(i) == 'K') {
process = process + array[10];
numbers[i] = array[10].length();
}
if (temp.charAt(i) == 'L') {
process = process + array[11];
numbers[i] = array[11].length();
}
if (temp.charAt(i) == 'M') {
process = process + array[12];
numbers[i] = array[12].length();
}
if (temp.charAt(i) == 'N') {
process = process + array[13];
numbers[i] = array[13].length();
}
if (temp.charAt(i) == 'O') {
process = process + array[14];
numbers[i] = array[14].length();
}
if (temp.charAt(i) == 'P') {
process = process + array[15];
numbers[i] = array[15].length();
}
if (temp.charAt(i) == 'Q') {
process = process + array[16];
numbers[i] = array[16].length();
}
if (temp.charAt(i) == 'R') {
process = process + array[17];
numbers[i] = array[17].length();
}
if (temp.charAt(i) == 'S') {
process = process + array[18];
numbers[i] = array[18].length();
}
if (temp.charAt(i) == 'T') {
process = process + array[19];
numbers[i] = array[19].length();
}
if (temp.charAt(i) == 'U') {
process = process + array[20];
numbers[i] = array[20].length();
}
if (temp.charAt(i) == 'V') {
process = process + array[21];
numbers[i] = array[21].length();
}
if (temp.charAt(i) == 'W') {
process = process + array[22];
numbers[i] = array[22].length();
}
if (temp.charAt(i) == 'X') {
process = process + array[23];
numbers[i] = array[23].length();
}
if (temp.charAt(i) == 'Y') {
process = process + array[24];
numbers[i] = array[24].length();
}
if (temp.charAt(i) == 'Z') {
process = process + array[25];
numbers[i] = array[25].length();
}
if (temp.charAt(i) == '_') {
process = process + array[26];
numbers[i] = array[26].length();
}
if (temp.charAt(i) == ',') {
process = process + array[27];
numbers[i] = array[27].length();
}
if (temp.charAt(i) == '.') {
process = process + array[28];
numbers[i] = array[28].length();
}
if (temp.charAt(i) == '?') {
process = process + array[29];
numbers[i] = array[29].length();
}
i++;
}
int k=numbers.length-1;
i=0;
while(i<process.length())
{
output=output+compare(array,process,i,numbers[k]);
i=i+numbers[k];
k--;
}
System.
out.
printf("%s\n",output
); }
}
}