Deep Abyss
시간 제한1초메모리 제한2048 MB
128비트 비트 연산으로 이루어진 해시 함수 h가 절차로 주어질 때 h(x)=x인 최소 고정점 x를 찾거나 없으면 :( 를 출력한다.
문제
Kieray has a hash function . She wants you to help her find a fixed point of , such that .
입력
The input contains the description of .
The function is described by a procedure in Frog language. In this language, variables (for example, , , ) are 128-bit unsigned integers. At the beginning, the variable contains the input value to , and the other variables are all initialized to zeroes. The result of is the value of variable after the execution of the procedure.
The procedure contains at most 500 lines. Each line is an assignment that stores the result of an expression into a variable. Frog language supports bitwise negation (~), and (&), or (|), xor (^), and left/right shifting (<</>>). The semantics of these operations are similar to those in C/C++.
Each assignment contains at most one binary operation. (Hexa)decimal constant numbers are allowed in expressions. The bitwise negation (~) can be applied to each variable or constant at most once. Every expression except bitwise xor expression (^) contains at most one variable. The shift amount (right operand) of a shifting operation is non-negative and not greater than 128.
Here is the extended BNF specification of the Frog language:

Note: "*" means the preceding token appears zero or more times, and "{1,4}" means the preceding token appears one to four times. The symbol "␣" represents a single space character.
출력
Print the fixed point of in hexadecimal without leading zeroes, conforming to the format of Hexadecimal in the extended BNF specification. If there are multiple fixed points, print the minimum one. If there is no fixed point, print ":(" (without quotes) instead.
힌트
This is an illustration from Kieray. It's lovely.
