Three Dimensions

아직 제출이 없습니다시간 제한1초메모리 제한256 MB

문제

Let's define a strange "distance" between two points a=(x_a,y_a,z_a)a=(x\_a,y\_a,z\_a) and b=(x_b,y_b,z_b)b=(x\_b,y\_b,z\_b) in three-dimensional space:

d(a,b)=maxx_ax_b,y_ay_b,z_az_bx_ay_az_ax_by_bz_b,d(a,b)=\max\\{|x\_a-x\_b|,|y\_a-y\_b|,|z\_a-z\_b|\\} \oplus x\_a \oplus y\_a \oplus z\_a \oplus x\_b \oplus y\_b \oplus z\_b,

where maxS\max\\{S\\}, x|x| and \oplus correspond to the maximum value in SS, the absolute value of xx and the bitwise exclusive-or operator respectively.

Given 66 non-negative integers mx_a,my_a,mz_a,mx_b,my_b,mz_bmx\_a,my\_a,mz\_a,mx\_b,my\_b,mz\_b, please find the sum of all d(a,b)d(a,b), where x_a\[0,mx_a],y_a\[0,my_a],z_a\[0,mz_a]x\_a \in \[0, mx\_a], y\_a \in \[0, my\_a], z\_a \in \[0, mz\_a] and x_b\[0,mx_b],y_b\[0,my_b],z_b\[0,mz_b]x\_b \in \[0, mx\_b], y\_b \in \[0, my\_b], z\_b \in \[0, mz\_b].  Since the sum may be very large, please output it modulo 2302^{30} instead.

Note that x_a,y_a,z_a,x_b,y_b,z_bx\_a,y\_a,z\_a,x\_b,y\_b,z\_b should all be integers.

입력

The input only contains 66 non-negative integers mx_a,my_a,mz_a,mx_b,my_b,mz_bmx\_a,my\_a,mz\_a,mx\_b,my\_b,mz\_b, each integer is not larger than 10910^9.

출력

Output an integer denoting the sum modulo 2302^{30}.