CF679E Bear and Bad Powers of 42
Description
Limak, a bear, isn't good at handling queries. So, he asks you to do it.
We say that powers of $ 42 $ (numbers $ 1,42,1764,... $ ) are bad. Other numbers are good.
You are given a sequence of $ n $ good integers $ t_{1},t_{2},...,t_{n} $ . Your task is to handle $ q $ queries of three types:
1. 1 i — print $ t_{i} $ in a separate line.
2. 2 a b x — for  set $ t_{i} $ to $ x $ . It's guaranteed that $ x $ is a good number.
3. 3 a b x — for  increase $ t_{i} $ by $ x $ . After this repeat the process while at least one $ t_{i} $ is bad.
You can note that after each query all $ t_{i} $ are good.
Input Format
N/A
Output Format
N/A
Explanation/Hint
After a query `3 2 4 42` the sequence is $ 40,1742,49,1714,4,1722 $ .
After a query `3 2 6 50` the sequence is $ 40,1842,149,1814,104,1822 $ .
After a query `2 3 4 41` the sequence is $ 40,1842,41,41,104,1822 $ .
After a query `3 1 5 1` the sequence is $ 43,1845,44,44,107,1822 $ .