import java.io.*;
import java.lang.*;
import java.util.*;

class Table {
  // \esc{Recherche Linéaire, voir page \pageref{prog:recherche-lineaire}}

  final static int N = 6;
  static String nom[] = new String[N+1];
  static int tel[] = new int[N+1];

  static void Initialisation() {
    nom[0] = "paul";  tel[0] = 2811;
    nom[1] = "roger";  tel[1] = 4501;
    nom[2] = "laure";  tel[2] = 2701;
    nom[3] = "anne";  tel[3] = 2702;
    nom[4] = "pierre";  tel[4] = 2805;
    nom[5] = "yves";  tel[5] = 2806;
  }

/*  static int Recherche (String x) {
    // \esc{Recherche 1, voir page \pageref{prog-recherche-1}}

    for (int i = 0; i < N; ++i)
        if (x.equals(nom[i]))
            return tel[i];
    return -1;
}

  static int Recherche (String x) {
  // \esc{Recherche 2, voir page \pageref{prog-recherche-2}} 

    int   i = 0;
    while (i < N  &&  !x.equals(nom[i]))
        ++i;
    if (i < N)
        return tel[i];
    else
        return -1;
}
*/

  static int Recherche (String x) {

    int  i = 0;
    nom[N] = x; tel[N] = -1;
    while (! x.equals(nom[i]))
        ++i;
    return tel[i];
  }


  public static void main(String args[]) {
      
    Initialisation();
    if (args.length == 1)
        System.out.println (Recherche(args[0]));
  }
}

