You, Mr. Hackerman, have gained access to the servers of a secure messaging app. They use a new ciphering method based on the difficulty of factoring the numbers that are products of three big primes.
You are reading the source code and found out how they actually generate these numbers. They define three recurrences:
The seeds x_0,y_0,z_0 seem to be stored in a secure file.
Now they get the three primes p_k,q_k,r_k for the k-th user:
X.axx (all its numbers are different primes with exactly 31 decimal digits).Y.axx (all its numbers are different primes with exactly 32 decimal digits).Z.axx (all its numbers are different primes with exactly 33 decimal digits).Then, they compute the public key n_k=p_k⋅q_k⋅r_k.
You have temporary access to the public key database, and you can query up to 5 public keys for any user.
You are given two integers u and v. You have to intercept communications between the u-th user and the v-th user. For this task, you will need to compute p_u,q_u,r_u,p_v,q_v,r_v; having these values will allow you to completely manipulate communication.
For the sake of input/output simplicity, we ask you to output p_u+q_u+r_u+p_v+q_v+r_v as your answer.
Solution to the example (u=10 and v=20):
p_10=6745719728113484794920696767881
q_10=54398126832702965410665141463513
r_10=523986762172023700466774225430947
p_20=6899037085323900149383957179569
q_20=76607972465670150189802211467309
r_20=520033106839239897778822214813477
p_10+q_10+r_10+p_20+q_20+r_20=1188670725123074098790368447122696