program Vizitkovac;

var meno,telefon,funkcia:string;
    i,dlzka : integer;

begin

  {Kedze program je, alebo aspon tak vyzera pomerne zlozito a je
  tu pouzitych mozno pre niekoho nieco nove, tak si pomozte mojim
  komentarom}

  {Klasicke nacitanie}

  write('Zadajte vase meno: ');
  readln(meno);
  write('Zadajte vasu funkciu vo firme: ');
  readln(funkcia);
  write('Zadajte vas kontaktny telefon: ');
  readln(telefon);


  {Toto je if so zlozitov podmienkou, ktora zistuje, ci je telefon
  na mobil alebo obycajny... Aby to bolo cislo na mobil, musi
  platit, ze je dlhe 10, a jeho prve cifry su 0, 9 a 0 (hoci viem
  ze uz su na Slovensku cisla na mobil, ktore vyzeraju aj inak, ale pre
  jednoduchost to berme takto). Funkcia length(string) nam vrati dlzku
  retazca = dlzku slova v zatvorkach}

  if ( length(telefon) = 10 ) and ( telefon[1] = '0' ) and
    ( telefon[2] = '9' ) and ( telefon[3] = '0' ) then
   telefon:= 'Mobil: '+telefon
  else telefon:='Telefon: '+telefon;

  {Teraz ideme urcit, ktore zo zadanych retazcov je najdlhsi a podla
  toho urcime rozmer vizitky. Vsimnime si, ze retazec telefon obsahuje
  nielen telefon, ale aj to ci je mobil alebo nie je - presne to, co sa
  ma objavit na vizitke.

  >= toto znamena vacsi alebo rovny... Nam staci aj dlzka, ktoru ma
  aj viec retazcov... Keby sme rovnost nepripustili, tak by sa nam mohlo
  v pripade, ked je vsetko rovnako dlhe, ze nam nevyberie ani jednu hodnotu
  - pretoze nic nieje vacsie ako dve ostatne... (snad sa to da pochopit z
  mojej krkolomnej formulacie... :-))}

  if ( length(meno) >= length(telefon) ) and ( length(meno) >= length(funkcia) )
    then dlzka := length(meno)+6;

  if ( length(funkcia) >= length(telefon) ) and ( length(funkcia) >= length(meno) )
    then dlzka := length(funkcia)+6;


  if ( length(telefon) >= length(meno) ) and ( length(telefon) >= length(funkcia) )
    then dlzka := length(telefon)+6;


  write('Ú');
  for i:=1 to dlzka-2 do write('Ä');
  writeln('¿');

  write('³');
  for i:=1 to dlzka-2 do write(' ');
  writeln('³');

  write('³');
  for i:=1 to ((dlzka-length(meno))div 2)-1 do write(' ');
  write(meno);
  if (dlzka-length(meno)) mod 2 = 0 then
  for i:=1 to ((dlzka-length(meno))div 2)-1 do write(' ')
  else for i:=1 to ((dlzka-length(meno))div 2) do write(' ');
  writeln('³');


  write('³');
  for i:=1 to dlzka-2 do write(' ');
  writeln('³');

  write('³');
  for i:=1 to ((dlzka-length(funkcia))div 2)-1 do write(' ');
  write(funkcia);
  if (dlzka-length(funkcia)) mod 2 = 0 then
  for i:=1 to ((dlzka-length(funkcia))div 2)-1 do write(' ')
  else for i:=1 to ((dlzka-length(funkcia))div 2) do write(' ');
  writeln('³');

  write('³');
  for i:=1 to dlzka-2 do write(' ');
  writeln('³');

  write('³');
  for i:=1 to ((dlzka-length(telefon))div 2)-1 do write(' ');
  write(telefon);
  if (dlzka-length(telefon)) mod 2 = 0 then
  for i:=1 to ((dlzka-length(telefon))div 2)-1 do write(' ')
  else for i:=1 to ((dlzka-length(telefon))div 2) do write(' ');
  writeln('³');

  write('³');
  for i:=1 to dlzka-2 do write(' ');
  writeln('³');


  write('À');
  for i:=1 to dlzka-2 do write('Ä');
  writeln('Ù');

  readln;

end.