login :-
    getdata(_, _),
    writeln('Welcome!').
login :-
    repeat,
    writeln('Sorry, you are not permitted.'),
    getdata(_, _),
    writeln('Welcome').

getdata(Name, Password) :-
    write('Username: '),
    read(Name),
    write('Password: '),
    read(Password),
    user(Name, Password).

user(john, john1).
user(jimmy, jimmy1).
user(mary, mary1).
