1. 

/**
* Angewandte Mathematik, SS09, IFB 2C
* ACM Problem #10260 (Soundex)
* Link: http://icpcres.ecs.baylor.edu/onlinejudge/index.php?option=com_onlinejudge&Itemid=8&category=14&page=show_problem&problem=1201
*
* @author Christian Posselt
* @author Jonathan Schubert
* @version 1.0, 04/07/2009
*
* Status : Accepted
* Runtime: 0.120
*/
import java.io.*;
import java.util.Scanner;


class Main
{
public static void main(String[] args)
{
BufferedInputStream bin = new BufferedInputStream(System.in);
Scanner sc = new Scanner(bin);
StringBuilder builder = new StringBuilder();
//given values foreach letter
final int[] table = new int[]{0,1,2,3,0,1,2,0,0,2,2,4,5,5,0,1,2,6,2,3,0,1,0,2,0,2};
// a b c d e f g h i j k l m n o p q r s t u v w x y z


while(sc.hasNext())
{
String s = sc.next();
int last = -1;
for(int i = 0; i < s.length(); i ++) //run thru string
{
char c = s.charAt(i);
int off = c-'A'; //calcluate offset for array

if(off < 27 && table[off] != last)
{
if(table[off] != 0)
builder.append(table[off]);
last = table[off];
}

}
builder.append("\n");
}
System.out.print(builder.toString());
}
}