Need help with arduino project

hello, i m doing a project with arduino mega, keypad, and servo but it is not working.
can someone help me?

#include <Servo.h>
#include <Keypad.h>

Servo ServoMotor;
int position = 0;
int A;
int B;
int C;
int D;
const byte ROWS = 4;
const byte COLS = 4;
char keys[ROWS][COLS] = {
{'1','2','3','A'},
{'4','5','6','B'},
{'7','8','9','C'},
{'*','0','#','D'}
};

byte rowPins[ROWS] = { 8, 7, 6, 9 };
byte colPins[COLS] = { 5, 4, 3, 2 };
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
int RedpinLock = 12;
int GreenpinUnlock = 13;

void setup()
{
ServoMotor.attach(11);
LockedPosition(true);
}

void loop()
{
char key = keypad.getKey();
if (key == '*' || key == '#')
{
position = 0;
LockedPosition(true);
}
A = key;
B = key;
C = key;
D = key;
if ((A==1) && (B==2) && (C==3) && (D==A)); 

{
LockedPosition(false);
}
delay(100);
}
void LockedPosition(int locked)
{
if (locked)
{
digitalWrite(RedpinLock, HIGH);
digitalWrite(GreenpinUnlock, LOW);
ServoMotor.write(11);
}
else
{
digitalWrite(RedpinLock, LOW);
digitalWrite(GreenpinUnlock, HIGH);
ServoMotor.write(87);
}
}

The code does something.
You expect it to do something.

When we know what those two things are, maybe we can help.

A = key;
B = key;
C = key;
D = key;

This happens even if key is NO_KEY.

if ((A==1) && (B==2) && (C==3) && (D==A));

Since you just assigned all 4 variables the same value, it is pointless to test that they contain different values.

It is equally pointless to put a ; at the end of the if statement, and expect it to do anything.

(deleted)