
Cirno's Perfect Math Class is now in session!
This is an interactive problem.
In the year 9999, the genius ice fairy Cirno has built the supercomputer Cirno9 capable of $$$1024$$$-bit integer arithmetic (int1024)! However, because Cirno is a genius, this machine only supports integer operations. Cirno9 has 8 general-purpose registers (variables) named $$$a,b,c,d,r_0,r_1,r_2,r_3$$$.
As a time traveler from 2025, you've obtained temporary access. Cirno9's first four registers $$$a,b,c,d$$$ are initialized with four positive integers $$$a_0,b_0,c_0,d_0$$$ representable by int1024, while the other four registers $$$r_0\cdots r_3$$$ are set to $$$0$$$. Your task is to use Cirno9 to compare the fractions $$$\dfrac{a_0}{b_0}$$$ and $$$\dfrac{c_0}{d_0}$$$.
You cannot directly observe the values of $$$a_0,b_0,c_0,d_0$$$, but you can send at most $$$6666$$$ operation requests to Cirno9 and make judgments based on its responses. See the "Interaction Protocol" section below for details.
Complete this task before Cirno releases "Perfect Freeze"!
Additional Notes
Since you come from an era with only int32 and int64 (and maybe int128), here are extra details about Cirno9's int1024:
There is no initial input. You must send queries to the interactor.
You may use $$$8$$$ int1024 variables named $$$a,b,c,d,r_0,r_1,r_2,r_3$$$ (corresponding strings: a b c d r0 r1 r2 r3).
You can perform the following operations:
Note: For operation types 1 and 2, variable names may be identical (e.g., "+ a a b" or "* r0 r0 r0").
Possible reasons for err responses:
When receiving err, your program will be judged as Wrong Answer. You should immediately terminate after reading err to avoid unexpected evaluation results.
You may perform at most $$$6666$$$ operations. The final answer doesn't count toward this limit; other operations count as $$$1$$$ each.
After printing an operation, do not forget to output the end of the line and flush the output. Otherwise you'll receive Time Limit Exceeded. Flushing methods:
ok ok ok > ok
* r0 a d * r1 b c - r0 r0 r1 ? r0 r2 ! >
In this sample, the initial values inside the interactor are $$$a = 99$$$, $$$b = 999$$$, $$$c = 9$$$, $$$d = 99$$$. We need to compare the sizes of $$$\frac{99}{999}$$$ and $$$\frac{9}{99}$$$.
The attachment provides a reference implementation of Cirno9, which you can use to test int1024.
| Name |
|---|


