:- prompt(_, '').
:- use_module(library(readutil)).
main:-
process,
ler_chars(S) :-
ler_resto(C,S).
ler_resto(end_of_file, []).
ler_resto(C, [C|R]) :-
ler_resto(C2, R).
nomes([]) --> [].
nomes([Nome|R]) --> nome(Nome), [' '], nomes(R).
nomes([Nome|R]) --> nome(Nome), ['\n'], nomes(R).
nomes([Nome]) --> nome(Nome).
nome(pessoa(Nome,Sobrenome)) --> palavra(CNome), ['.'], palavra(CSobrenome),
palavra([]) --> [].
palavra([C|R]) --> [C], { is_alpha(C) }, palavra(R).
process:-
ler_chars(Chars),
nomes(Pessoas, Chars, []),
:- main.
Oi0gc2V0X3Byb2xvZ19mbGFnKHZlcmJvc2Usc2lsZW50KS4KOi0gcHJvbXB0KF8sICcnKS4KOi0gdXNlX21vZHVsZShsaWJyYXJ5KHJlYWR1dGlsKSkuCgptYWluOi0KCXByb2Nlc3MsCgloYWx0LgoJCmxlcl9jaGFycyhTKSA6LQogICAgZ2V0X2NoYXIoQyksCiAgICBsZXJfcmVzdG8oQyxTKS4KCmxlcl9yZXN0byhlbmRfb2ZfZmlsZSwgW10pLgpsZXJfcmVzdG8oQywgW0N8Ul0pIDotCiAgICBnZXRfY2hhcihDMiksCiAgICBsZXJfcmVzdG8oQzIsIFIpLgoJCm5vbWVzKFtdKSAtLT4gW10uCm5vbWVzKFtOb21lfFJdKSAtLT4gbm9tZShOb21lKSwgWycgJ10sIG5vbWVzKFIpLgpub21lcyhbTm9tZXxSXSkgLS0+IG5vbWUoTm9tZSksIFsnXG4nXSwgbm9tZXMoUikuCm5vbWVzKFtOb21lXSkgLS0+IG5vbWUoTm9tZSkuCgpub21lKHBlc3NvYShOb21lLFNvYnJlbm9tZSkpIC0tPiBwYWxhdnJhKENOb21lKSwgWycuJ10sIHBhbGF2cmEoQ1NvYnJlbm9tZSksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgYXRvbV9jaGFycyhOb21lLCBDTm9tZSksIGF0b21fY2hhcnMoU29icmVub21lLCBDU29icmVub21lKSB9LgoKcGFsYXZyYShbXSkgLS0+IFtdLgpwYWxhdnJhKFtDfFJdKSAtLT4gW0NdLCB7IGlzX2FscGhhKEMpIH0sIHBhbGF2cmEoUikuCgpwcm9jZXNzOi0KCWxlcl9jaGFycyhDaGFycyksCglub21lcyhQZXNzb2FzLCBDaGFycywgW10pLAoJd3JpdGUoUGVzc29hcyksIG5sLAoJdHJ1ZS4KCjotIG1haW4u