/*****************************************************************
** Encode - encode words as per the numbers on a telephone keypad
**
** Here's is a sample dialogue:
**
**    PROMPT>java Encode
**    the quick brown fox jumped over the lazy dogs
**    843 78425 27696 369 586733 6837 843 5299 3647
**    ^z
**    PROMPT>
**
** (c) Scott MacKenzie, 2000
******************************************************************/
import java.io.*;
import java.util.*;

public class Encode
{
   public static void main(String[] args) throws IOException
   {
      BufferedReader stdin =
         new BufferedReader(new InputStreamReader(System.in), 1);

      // process lines until no more input
      String line;
      StringTokenizer st;
      while ((line = stdin.readLine()) != null)
      {
         // process words in line
         st = new StringTokenizer(line);
         while (st.hasMoreTokens())
         {
            String eWord = EncodedWord.encodeWord(st.nextToken());
            System.out.print(eWord + " ");
         }
         System.out.println();
      }
   }
}

