PROGRAM Telephone (Input,Output);

VAR
   Letter, Digit : Char;

BEGIN

   Writeln('Enter letter on telephone dial');
   Readln(Letter);

   Digit := '0';

   IF (Letter='A') OR (Letter='B') OR (Letter='C') THEN
      Digit := '2'
   ELSE IF (Letter='D') OR (Letter='E') OR (Letter='F') THEN
      Digit := '3'
   ELSE IF (Letter='G') OR (Letter='H') OR (Letter='I') THEN
      Digit := '4'
   ELSE IF (Letter='J') OR (Letter='K') OR (Letter='L') THEN
      Digit := '5'
   ELSE IF (Letter='M') OR (Letter='N') OR (Letter='O') THEN
      Digit := '6'
   ELSE IF (Letter='P') OR (Letter='R') OR (Letter='S') THEN
      Digit := '7'
   ELSE IF (Letter='T') OR (Letter='U') OR (Letter='V') THEN
      Digit := '8'
   ELSE IF (Letter='W') OR (Letter='X') OR (Letter='Y') THEN
      Digit := '9'
   ELSE IF (Letter='Q') OR (Letter='Z') THEN
      Writeln(Letter,' does not exist on dial')
   ELSE
      Writeln('Only input an uppercase letter');

   IF (Digit >= '1') AND (Digit <= '9') THEN
      Writeln(Letter,' corresponds to ',Digit);
END.

