><>, 1916 bytes
i:0(?;\
g?!o2p\;:::21g?!o1p
> doesn't have strings, so we make use of the codebox. TheDue to the toroidal nature of >, the following runs in a loop:
i Read a char
:0(?; Halt if EOF
::: Push three copies of the char
2g1g Get the value at (char, 21), which is 0 by default
?!o Print the char if the value was nonzero
2p1p Set the value at (char, 21) to char
Note that this uses the fact that the input only contains printable ASCII, as this would not work if ASCII 0 was present.