#List of characters:
#import string
#print (string.printable)
L1 = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&()*+,-./:;<=>?@[\]^_`{|}~' *999999 #This multiplies the extension of L1
#L1 must contain all possible keyboard symbols
#Randomeness in L1 increases layer of unpredictivity
while True:
print ('')
print ('')
print ('Encript=E /Decrypt=D')
EorD = input()
EorD = EorD.lower()
if EorD == 'e':
#Message
print('')
print ('Introduce text to encrypt.')
MESS = input()
#Password (number of translations)
print ('6-digit Numerical Password')
PASS = int(input())
#Item by item translation
for LETTER in MESS:
NEWPOS = L1.find(LETTER)+ PASS
if NEWPOS == 0 :
print ('fuc')
break
elif NEWPOS >= len(L1):
print ('try again with a smaller password')
print (L1[NEWPOS], end = '')
elif EorD == 'd':
#Message
print('')
print ('Paste text to decrypt.')
MESS = input()
#Password (number of translations)
print ('6-digit Numerical Password')
PASS = int(input())
#Item by item translation
for LETTER in MESS:
NEWPOS = L1.find(LETTER)- PASS
if NEWPOS < 0:
print ( end = '')
print (L1[NEWPOS], end = '')