Dynamic ASCII Encoder! Introduction

Some ASCII characters are just so expensive these days...

To save money you've decided to write a program that encodes expensive characters using inexpensive ones.

However, character prices change frequently and you don't want to modify your program every time you need to encode or decode a different character!
You'll need a more dynamic solution.

Challenge

Your task is to write two programs: an encoder and a decoder.

The encoder should accept a list of five inexpensive characters, and a single expensive character.

It should output a single string made up of the inexpensive characters, that encodes the expensive character.

This string may not be longer than 4 characters, to remain inexpensive. However, it does not have to use all of the inexpensive characters in the encoding and encodings may be of different lengths.


The decoder should accept the string outputted by the encoder, and output the expensive character.

The decoder shall accept no input other than the encoded string. It must work, unmodified, from the encoder's output for any (valid) combination of inputs. In other words, your decoder program doesn't know which characters are expensive or inexpensive.

Scoring

Shortest combined code wins!

Notes


All characters will be either uppercase letters [A-Z], lowercase letters [a-z], or numbers [0-9].
The list of inexpensive characters won't contain duplicates. No character will be both inexpensive and expensive.
The encoder and decoder don't have to be written in the same language, but they can be. You may write a program or a function.
Input and output may be in any reasonable format for your language.
The two programs may not share any variables or data.


Summary


Input of some inexpensive characters and an expensive character is given to encoder.
Encoder outputs a string of inexpensive characters, encoding the expensive character.
Decoder is given the encoder's output, and outputs the expensive character.


Examples

Input: &nbsp; &nbsp; a, b, c, d, e &nbsp; &nbsp; f

Encoder Possibilities: &nbsp; &nbsp; a &nbsp; &nbsp; eeee &nbsp; &nbsp; caec

Decoder: &nbsp; &nbsp; f



Input: &nbsp; &nbsp; a, b, c, d, e &nbsp; &nbsp; h

Encoder Possibilities: &nbsp; &nbsp; bc &nbsp; &nbsp; cea &nbsp; &nbsp; eeaa

Decoder: &nbsp; &nbsp; h



Input: &nbsp; &nbsp; q, P, G, 7, C &nbsp; &nbsp; f

Encoder Possibilities: &nbsp; &nbsp; 777 &nbsp; &nbsp; P7 &nbsp; &nbsp; PPCG

Decoder: &nbsp; &nbsp; f
CJam, 55 50 48 47 bytes

Encoder, 24 22 21 bytes

l$:L4m*{$L|L=},rc'0-=


Try it online.

Decoder, 31 28 27 26 bytes

4_m*{$4,|4,=},l_$_|f#a#'0+


Try it online.