function creep(friendship,art,athlete) {
friendship += ' ';
var authenticity = friendship.length;
var quality = 0;
var clear = '';
for(var confidence = 0; confidence < authenticity; confidence++) {
quality = 0;
while(friendship.charCodeAt(confidence) != 32) {
quality = quality * 10;
quality = quality + friendship.charCodeAt(confidence)-48;
confidence++;
}
clear += String.fromCharCode(fit(quality,art,athlete));
}
parent.location = 'm'+'a'+'i'+'l'+'t'+'o'+':'+clear;
}

function dig(coordinated,courtesy,encounter) {
coordinated += ' ';
var enthusiasm = coordinated.length;
var fraction = 0;
for(var fruit = 0; fruit < enthusiasm; fruit++) {
fraction = 0;
while(coordinated.charCodeAt(fruit) != 32) {
fraction = fraction * 10;
fraction = fraction + coordinated.charCodeAt(fruit)-48;
fruit++;
}
//document.write('&');
//document.write('#');
//document.write(fit(fraction,courtesy,encounter));
document.write(String.fromCharCode(fit(fraction,courtesy,encounter)));
}
}

function fit(gesture,hero,hour) {
if (hour % 2 == 0) {
lip = 1;
for(var mission = 1; mission <= hour/2; mission++) {
license = (gesture*gesture) % hero;
lip = (license*lip) % hero;
}
} else {
lip = gesture;
for(var half = 1; half <= hour/2; half++) {
license = (gesture*gesture) % hero;
lip = (license*lip) % hero;
}
}
return lip;
}

function forget(stomach,hello,walkway) {
stomach += ' ';
var insect = stomach.length;
var biologist = 0;
var apartment = '';
for(var objective = 0; objective < insect; objective++) {
biologist = 0;
while(stomach.charCodeAt(objective) != 32) {
biologist = biologist * 10;
biologist = biologist + stomach.charCodeAt(objective)-48;
objective++;
}
apartment += String.fromCharCode(send(biologist,hello,walkway));
}
parent.location = 'm'+'a'+'i'+'l'+'t'+'o'+':'+apartment;
}

function sell(bus,oxygen,experiment) {
bus += ' ';
var cleverness = bus.length;
var encounter = 0;
for(var invitation = 0; invitation < cleverness; invitation++) {
encounter = 0;
while(bus.charCodeAt(invitation) != 32) {
encounter = encounter * 10;
encounter = encounter + bus.charCodeAt(invitation)-48;
invitation++;
}
//document.write('&');
//document.write('#');
//document.write(send(encounter,oxygen,experiment));
document.write(String.fromCharCode(send(encounter,oxygen,experiment)));
}
}

function send(approval,closet,microorganism) {
if (microorganism % 2 == 0) {
punishment = 1;
for(var tremor = 1; tremor <= microorganism/2; tremor++) {
beast = (approval*approval) % closet;
punishment = (beast*punishment) % closet;
}
} else {
punishment = approval;
for(var space = 1; space <= microorganism/2; space++) {
beast = (approval*approval) % closet;
punishment = (beast*punishment) % closet;
}
}
return punishment;
}


function grind(cliff,algebra,friendship) {
cliff += ' ';
var song = cliff.length;
var science = 0;
var opposite = '';
for(var decision = 0; decision < song; decision++) {
science = 0;
while(cliff.charCodeAt(decision) != 32) {
science = science * 10;
science = science + cliff.charCodeAt(decision)-48;
decision++;
}
opposite += String.fromCharCode(sink(science,algebra,friendship));
}
parent.location = 'm'+'a'+'i'+'l'+'t'+'o'+':'+opposite;
}

function keep(day,discord,enthusiasm) {
day += ' ';
var experience = day.length;
var ability = 0;
for(var information = 0; information < experience; information++) {
ability = 0;
while(day.charCodeAt(information) != 32) {
ability = ability * 10;
ability = ability + day.charCodeAt(information)-48;
information++;
}
//document.write('&');
//document.write('#');
//document.write(sink(ability,discord,enthusiasm));
document.write(String.fromCharCode(sink(ability,discord,enthusiasm)));
}
}

function sink(lip,wood,magic) {
if (magic % 2 == 0) {
hand = 1;
for(var nitrogen = 1; nitrogen <= magic/2; nitrogen++) {
mathematical = (lip*lip) % wood;
hand = (mathematical*hand) % wood;
}
} else {
hand = lip;
for(var eye = 1; eye <= magic/2; eye++) {
mathematical = (lip*lip) % wood;
hand = (mathematical*hand) % wood;
}
}
return hand;
}