Harryxun/stf_run huggingface dataset:
import copy

def main():
    def gcd(a, b):
        if b == 0:
            return a
        else:
            return gcd(b, a%b)

    def lcm(a, b):
        return (a // gcd(a, b)) * b

    n, m = map(int, input().split())
    # これだと72がREになる
    A = set([int(x) for x in input().split()])
    # これだと74も78もREになる
    # A = [int(x) for x in input().split()]
    # A_ = copy.deepcopy(A)
    # a_lcm = A.pop()
    a_lcm = 1
    # Aの要素が複数ならlcmを計算する
    #if len(A) >= 1:
    for a in A:
        a_lcm = lcm(a_lcm, a)
    #else:
    #    a_lcm = a_lcm
    # 元のAの値とlcmの半分の値を割り切れるものがあったら0
    #for i in A_:
    for i in A:
        if (a_lcm / 2) % i == 0:
        # if (a_lcm / i) % 2 == 0: 
            print(0)
            exit()
        # else:
        #     continue
    # mがlcmの半分よりも小さかったら0
    # if (a_lcm / 2) > m:
    if a_lcm > m * 2:
        print(0)
    else:
        # あとは定数倍の数調べて終わり
        # ans = int((m - (a_lcm / 2))) // a_lcm + 1
        # ans = int((m - (a_lcm / 2)) // a_lcm) + 1
        a_lcm = a_lcm // 2
        q = m // a_lcm
        if q % 2 == 0:
            ans = q // 2
        else:
            ans = q // 2 + 1
    print(ans)

if __name__ == '__main__':
    main()

### FIXED CODE ###

import copy
# from math import gcd


def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a%b)

def lcm(a, b):
    return (a // gcd(a, b)) * b
def main():
    n, m = map(int, input().split())
    A = set([int(x) for x in input().split()])
    a_lcm = 1
    for a in A:
        a_lcm = lcm(a_lcm, a)
        # mがlcmの半分よりも小さかったら0
        if (a_lcm / 2) > m:
            print(0)
            exit()
    for a in A:
        if (a_lcm / 2) % a == 0:
            print(0)
            exit()
    # # あとは定数倍の数調べて終わり
    ans = int((m - (a_lcm / 2)) // a_lcm) + 1
    print(ans)

if __name__ == '__main__':
    main()
# input
h, w = [int(i) for i in input().split()]
ary = []
for y in range(h):
    line = input()
    ary.append(line)


from copy import deepcopy


def update(ary):
    tmp = deepcopy(ary)
    for y in range(h):
        for x in range(w):
            if ary[y][x] == 0:
                if x > 0:
                    tmp[y][x-1] = min(ary[y][x-1], 0)
                if x < w-1:
                    tmp[y][x+1] = min(ary[y][x+1], 0)
                if y > 0:
                    tmp[y-1][x] = min(ary[y-1][x], 0)
                if y < h-1:
                    tmp[y+1][x] = min(ary[y+1][x], 0)
                tmp[y][x] = -1
    return tmp


def init_ary(ary):
    # #. -> 0, 1, 2
    tmp = [[] for i in range(w)]
    for y in range(h):
        for x in range(w):
            tmp[y].append(1 if ary[y][x] == '.' else 0)
    return tmp


def is_all_black(ary):
    return not any(1 in line for line in ary)

ary = init_ary(ary)

count = 0

while not is_all_black(ary):
    ary = update(ary)
    count += 1

print(count)


### FIXED CODE ###

# input
h, w = [int(i) for i in input().split()]
ary = []
for y in range(h):
    ary.append([None if i == '.' else 0 for i in input()])


from collections import deque

update_q = deque((y, x) for y, line in enumerate(ary) for x, elem in enumerate(line) if elem == 0)

def update(ary, update_q):
    for _ in range(len(update_q)):
        pos = update_q.popleft()
        y, x = pos
        if x > 0:
            uy, ux = y, x-1
            if ary[uy][ux] is None:
                ary[uy][ux] = ary[y][x] + 1
                update_q.append((uy, ux))
        if x < w-1:
            uy, ux = y, x+1
            if ary[uy][ux] is None:
                ary[uy][ux] = ary[y][x] + 1
                update_q.append((uy, ux))
        if y > 0:
            uy, ux = y-1, x
            if ary[uy][ux] is None:
                ary[uy][ux] = ary[y][x] + 1
                update_q.append((uy, ux))
        if y < h-1:
            uy, ux = y+1, x
            if ary[uy][ux] is None:
                ary[uy][ux] = ary[y][x] + 1
                update_q.append((uy, ux))
    return ary, update_q


black_count = len(update_q)
update_count = 0
while black_count < w * h:
    ary, update_q = update(ary, update_q)
    black_count += len(update_q)
    update_count += 1


print(update_count)
import array
import bisect


def is_prime_number(num):
    limit = int(num ** 0.5)

    for lp in range(3, limit + 1, 2):
        if num % lp == 0:
            return False

    return True


LENGTH = 1000000
prime_number_list = array.array("i", [True] * (LENGTH + 1))

prime_number_list[0] = False
prime_number_list[1] = False

for lp in range(4, LENGTH + 1, 2):
    prime_number_list[lp] = False

limit = int((LENGTH + 1) ** 0.5)

for lp in range(3, limit + 1, 2):
    if is_prime_number(lp):
        for lp2 in range(lp * 2, LENGTH + 1, lp):
            prime_number_list[lp2] = False

prime_number_list = array.array("i", [index for index, item in enumerate(prime_number_list) if item])

while True:

    input_num = int(input())

    if input_num == 0:
        break

    count = 0

    array_size = bisect.bisect_left(prime_number_list, input_num // 2)

    for lp in prime_number_list[:array_size + 1]:

        search_num = input_num - lp

        index = bisect.bisect_left(prime_number_list, search_num)

        if prime_number_list[index] == search_num:
            count += 1

    print(count)



### FIXED CODE ###

import array


def is_prime_number(num):
    limit = int(num ** 0.5)

    for lp in range(3, limit + 1, 2):
        if num % lp == 0:
            return False

    return True


LENGTH = 1000000
prime_number_list = array.array("i", [True] * (LENGTH + 1))

prime_number_list[0] = False
prime_number_list[1] = False

for lp in range(4, LENGTH + 1, 2):
    prime_number_list[lp] = False

limit = int((LENGTH + 1) ** 0.5)

for lp in range(3, limit + 1, 2):
    if is_prime_number(lp):
        for lp2 in range(lp * 2, LENGTH + 1, lp):
            prime_number_list[lp2] = False

while True:
    input_num = int(input())

    if input_num == 0:
        break

    count = 0

    for lp in range(2, input_num // 2 + 1):

        if prime_number_list[lp] and prime_number_list[input_num - lp]:
            count += 1

    print(count)
import collections

n=int(input())
arr=[int(input()) for _ in range(n)]
arr=sorted(arr)
q=collections.deque()
q.append(arr[0])
l=1
r=n-1
if n%2==1:
  while 1:
    q.appendleft(arr[r])
    r-=1
    q.append(arr[r])
    r-=1
    if n%4==3:
      break
    q.appendleft(arr[l])
    l+=1
    q.append(arr[l])
    l+=1
    if abs(l-r)==1:
      break
  q=list(q)
  ans=0
  for i in range(n-1):
    ans+=abs(q[i+1]-q[i])
  print(ans)
else:
  flag=0
  while 1:
    if l==r:
      flag=0
      break
    q.appendleft(arr[r])
    r-=1
    q.append(arr[r])
    r-=1
    if n%4==0:
      flag=1
      break
    q.appendleft(arr[l])
    l+=1
    q.append(arr[l])
    l+=1
  q=list(q)
  ans=0
  for i in range(n-2):
    ans+=abs(q[i+1]-q[i])
  ans+=max(abs(arr[l]-q[0]),abs(arr[l]-q[-1]))
  print(ans)

### FIXED CODE ###

import collections

n=int(input())
arr=[int(input()) for _ in range(n)]
arr=sorted(arr)
if n%2==1:
  q=collections.deque()
  q.append(arr[0])
  l=1
  r=n-1
  move=1
  while 1:
    q.appendleft(arr[r])
    r-=1
    q.append(arr[r])
    r-=1
    move+=2
    if move==n:
      break
    q.appendleft(arr[l])
    l+=1
    q.append(arr[l])
    l+=1
    move+=2
    if move==n:
      break
  q=list(q)
  ans1=0
  for i in range(n-1):
    ans1+=abs(q[i+1]-q[i])
  q=collections.deque()
  q.append(arr[-1])
  l=0
  r=n-2
  move=1
  while 1:
    q.appendleft(arr[l])
    l+=1
    q.append(arr[l])
    l+=1
    move+=2
    if move==n:
      break
    q.appendleft(arr[r])
    r-=1
    q.append(arr[r])
    r-=1
    move+=2
    if move==n:
      break
  q=list(q)
  ans2=0
  for i in range(n-1):
    ans2+=abs(q[i+1]-q[i])
  ans=max(ans1,ans2)
  print(ans)
else:
  q=collections.deque()
  q.append(arr[0])
  l=1
  r=n-1
  move=1
  while 1:
    if n-move==1:
      break
    q.appendleft(arr[r])
    r-=1
    q.append(arr[r])
    r-=1
    move+=2
    if n-move==1:
      break
    q.appendleft(arr[l])
    l+=1
    q.append(arr[l])
    l+=1
    move+=2
  q=list(q)
  ans1=0
  for i in range(n-2):
    ans1+=abs(q[i+1]-q[i])
  ans1+=max(abs(arr[l]-q[0]),abs(arr[l]-q[-1]))
  q=collections.deque()
  q.append(arr[-1])
  l=0
  r=n-2
  move=1
  while 1:
    if n-move==1:
      break
    q.appendleft(arr[l])
    l+=1
    q.append(arr[l])
    l+=1
    move+=2
    if n-move==1:
      break
    q.appendleft(arr[r])
    r-=1
    q.append(arr[r])
    r-=1
    move+=2
  q=list(q)
  ans2=0
  for i in range(n-2):
    ans2+=abs(q[i+1]-q[i])
  ans2+=max(abs(arr[r]-q[0]),abs(arr[r]-q[-1]))
  ans=max(ans1,ans2)
  print(ans)
n=int(input())
a={}
for i in range(n):
    b=int(input())
    if b in a[b]:
        del a[b]
    else:
        a[b]=1

print(len(a))

### FIXED CODE ###

n=int(input())
a={}
for i in range(n):
    b=int(input())
    if b in a:
        del a[b]
    else:
        a[b]=1

print(len(a))
N,T=map(int,input().split())
li = [list(map(int,input().split())) for i in range(N)]
#print(li)
t_cost=[T - li[i][1] for i in range(N)]
#print(t_cost)
if(all(x < 0 for x in t_cost)):#時間内Tに帰宅不可能な場合
  print('TLE')
else:#時間内に帰宅できる場合に最小コストのものを出力
  t_cost_1=[]
  for i in range(N):
    if(t_cost[i]>=0):
      t_cost_1.append(i)
    else:continue
  #print(t_cost_1)
  print(min([li[t_cost_1[i]][0] for i in range(len(t_cost_1))]))

### FIXED CODE ###

if(1==int(input())):
  print('Hello World')
else:
  x,y=[int(input()) for i in range(2)]
  print(x+y)
t=str(input())
k=int(input())
L = len(t)
tmp = t[0]
n = 0 #change
flag = 0
for i in range(1,L):
  if flag==1:
    flag=0
  elif t[i]==tmp:# and flag==0:
    n+=1
    flag=1  
  tmp=t[i]
ans=k*n

if t[0]==t[-1] and t[-2]!=t[-1]:
  ans+=k-1
print(ans)

### FIXED CODE ###

t=str(input())
k=int(input())
L = len(t)
tmp = t[0]
n = 0 #change
flag = 0
for i in range(1,L):
  if flag==1:
    flag=0
  elif t[i]==tmp:
    n+=1
    flag=1  
  tmp=t[i]
ans=k*n
if L>2:
  if t[0]==t[-1] and flag==0:
    u = t[0]+t
    tmp = u[0]
    m = 0 #change
    flag = 0
    for i in range(1,L+1):
      if flag==1:
        flag=0
      elif u[i]==tmp:
        m+=1
        flag=1  
      tmp=u[i]
    if m!=n: 
      ans+=k-1

if t.count(t[0])==L:
  ans=(k*L)//2
print(ans)
N = int(input())
A = list(map(int, input().split()))
def gcd(a, b):
    P = max(a, b)
    Q = min(a, b)
    R = P%Q
    P = Q
    Q = R
    while R != 0:
        R = P%Q
        P = Q
        Q = R
    return P

candidate = [(gcd(A[0], A[1]), True), (A[0], False), (A[1], False)]
for i in range(2, N):
    nxt_cand = []
    for v, b in candidate:
        if(v == 1):
            continue
        if(b == True and gcd(v, A[i]) < v):
            nxt_cand.append((v, False))
        else:
            nxt_cand.append((gcd(v, A[i]), b))
    candidate = nxt_cand[::]

print(max(candidate)[0])


### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
def gcd(a, b):
    P = max(a, b)
    Q = min(a, b)
    R = P%Q
    P = Q
    Q = R
    while R != 0:
        R = P%Q
        P = Q
        Q = R
    return P

candidate = [(gcd(A[0], A[1]), True), (A[0], False), (A[1], False)]
for i in range(2, N):
    nxt_cand = []
    for v, b in candidate:
        if(v == 1):
            continue
        if(b == True and gcd(v, A[i]) < v):
            nxt_cand.append((v, False))
            nxt_cand.append((gcd(v, A[i]), True))
        else:
            nxt_cand.append((gcd(v, A[i]), b))
    if(len(nxt_cand)==0):
        nxt_cand = [(1, False)]
    candidate = nxt_cand[::]

print(max(candidate)[0])
x=raw_input()
print(x**3)

### FIXED CODE ###

print(pow(int(input()),3))
from collections import defaultdict

n = int(input())
seen = []
path = defaultdict(dict)

for _ in range(n-1):
    u, v, w = map(int, input().split())
    path[u][v] = w
    path[v][u] = w


def dfs(seen, pos, color):
    if seen[pos] == color:
        return
    elif seen[pos] == 1 - color:
        return False
    else:
        seen[pos] = color
        for nx in path[pos].keys():
            if path[pos][nx] % 2 == 1:
                color = 1 - color
            dfs(seen, nx, color)


for start in range(1, n + 1):
    seen = [-1] * (n+1)
    if dfs(seen, start, 0) is None:
        break

for i in range(1, n+1):
    print(seen[i])


### FIXED CODE ###

from collections import defaultdict
import sys
sys.setrecursionlimit(10**7)

n = int(input())
seen = [-1]*(n+1)
path = defaultdict(dict)

for _ in range(n-1):
    u, v, w = map(int, input().split())
    path[u][v] = w
    path[v][u] = w


def dfs(seen, pos, color):
    if seen[pos] != -1:
        return
    else:
        seen[pos] = color
        change_color = 1 - color
        for nx in path[pos].keys():
            check = path[pos][nx]
            if check % 2 == 1:
                dfs(seen, nx, change_color)
            dfs(seen, nx, color)


dfs(seen, 1, 0)
for i in range(1, n+1):
    print(seen[i])
w = input()
cnt = 0
while(True):
    t = input()
    if t == "END_OF_TEXT":
        break
    t = list(map(lower, t.split()))
    for i in t:
        if i == w:
            cnt += 1
print(cnt)


### FIXED CODE ###

w = input()
cnt = 0
while(True):
    t = input()
    if t == "END_OF_TEXT":
        break
    t = t.lower().split()
    for i in t:
        if i == w:
            cnt += 1
print(cnt)
while 1
    x, y = map(int, raw_input().split())
    if x == 0 and y == 0:
        break
    print '%d %d' %(min(x, y), max(x, y))

### FIXED CODE ###

while 1:
    x, y = map(int, raw_input().split())
    if x == 0 and y == 0:
        break
    print min(x, y), 
    print max(x, y)
import sys
input = sys.stdin.readline
from collections import deque
n = int(input())
ab = [list(map(int,input().split())) for i in range(n-1)]
graph = [[] for i in range(n+1)]
deg = [0]*(n+1)
for a,b in ab:
  graph[a].append(b)
  graph[b].append(a)
  deg[a] += 1
  deg[b] += 1
key = [0]*(n+1)
stack = deque()
root = 0
for i in range(1,n+1)[::-1]:
  if deg[i] == 1:
    stack.append(i)
  else:
    deg[i] += 1
dp = [[] for i in range(n+1)]
seen = 0
parity = [-1]*(n+1)
flg = 0
seen = len(stack)
while stack:
  x = stack.popleft()
  if dp[x]:
    if dp[x].count(0) >= 2:
      flg = 1
      break
    elif dp[x].count(2):
      parity[x] = 2
    elif dp[x].count(1) and dp[x].count(0):
      parity[x] = 2
    elif dp[x].count(1):
      parity[x] = 0
    elif dp[x].count(0):
      parity[x] = 1
  else:
    parity[x] = 0
  for y in graph[x]:
    if (seen < n-1 and deg[y] >= 3) or (seen == n-1 and deg[y] >= 2):
      dp[y].append(parity[x])
      deg[y] -= 1
      if (seen < n-1 and deg[y] == 2) or (seen == n-1 and deg[y] == 1):
        stack.append(y)
        seen += 1
if flg:
  print("First")
else:
  print(2/0)
  print("Second")

### FIXED CODE ###


import sys
input = sys.stdin.readline
n = int(input())
ab = [list(map(int,input().split())) for i in range(n-1)]
graph = [[] for i in range(n+1)]
deg = [0]*(n+1)
for a,b in ab:
  graph[a].append(b)
  graph[b].append(a)
  deg[a] += 1
  deg[b] += 1
if n == 2:
  print("Second")
  exit()
stack = []
root = 0
for i in range(1,n+1)[::-1]:
  if deg[i] == 1:
    stack.append(i)
  else:
    root = i
flg = 0
deg[root] += 1
dp = [[] for i in range(n+1)]
dist = [-1]*(n+1)
while stack:
  x = stack.pop()
  if dp[x]:
    if dp[x].count(0)>=2:
      flg = 1
    if dp[x].count(0):
      dist[x] = 1
    else:
      dist[x] = 0
  else:
    dist[x] = 0
  for y in graph[x]:
    if deg[y] >= 2:
      dp[y].append(dist[x])
      deg[y] -= 1
      if deg[y] == 1:
        stack.append(y)
if flg or dist[root]==0:
  print("First")
else:
  print("Second")
x = int(input())
L = [n**k for n in range(1, x) for k in range(1, x) if n**k<=x]
print (max(L))

### FIXED CODE ###

x = int(input())
if x == 1:
  print(x)
else:
  L = [n**k for n in range(1, x//2) for k in range(2, 10) if n**k<=x]
  print (max(L))
a,b,c = map(int,input().split()) ;
count = 0 ;
for i in range(a,b+1) :
  d = c % i ;
  if d == 0 :
     count = count +1
  
print("%d" % count) 

### FIXED CODE ###

a, b = [int(x) for x in input().split(' ')]
 
d = a // b
r = a % b
f = a / b
 
print("{0} {1} {2:.5f}".format(d, r, f))
S = input()
print("HEISEI" if S <= 2019/4/30 else "TBD")

### FIXED CODE ###

_,m,_ = map(int,input().split("/"))
print("TBD" if m > 4 else "Heisei")
using namespace std;
 
int main()
{
  double x1, x2, y1, y2;
 
  cin >> x1 >> y1 >> x2 >> y2;
 
  cout << fixed << setprecision(6) << sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)) << endl;
   
  return 0;
}

### FIXED CODE ###

from math import hypot
 
x1, y1, x2, y2 = map(float, input().strip().split())
print(hypot(x2 - x1, y2 - y1))
def chmin_orig(i1, i2):
    if dp[i1] > (dp[i2] + abs(vals[i1]-vals[i2])):
        dp[i1] = dp[i2] + abs(vals[i1]-vals[i2])
        return True
    return False


dp = [math.inf] * 100010
dp[0] = 0
for i in range(N):
    chmin_orig(i, i-1)
    if i > 1:
        chmin_orig(i, i-2)

print(dp[N-1])

### FIXED CODE ###

import math

N = int(input())
vals = list(map(int, input().split()))


def chmin_orig(i1, i2):
    if dp[i1] > (dp[i2] + abs(vals[i1]-vals[i2])):
        dp[i1] = dp[i2] + abs(vals[i1]-vals[i2])
        return True
    return False


dp = [float('inf')] * 100010
dp[0] = 0
for i in range(N):
    chmin_orig(i, i-1)
    if i > 1:
        chmin_orig(i, i-2)

print(dp[N-1])
N = int(input())
 
for i in range(9,1,-1):
	if N%i==0:
      if N//i==1:
        print("Yes")
      for j in range(9,1,-1):
      	if N%(i*j)==0:
          print("Yes")
          break
      	print("No")
        break

### FIXED CODE ###

N = int(input())

for i in range(1, 10):
    for j in range(1, 10):
        if i * j == N:
            break
    if i * j == N:
        print("Yes")
        break
    elif i == 9 and i * j != N:
        print("No")
a,b = map(int,input().split())
s = ''
if a> b:
    for i in range(len(b)):
        s = s+str(a)
else:
    for i in range(len(a)):
        s = s+str(b)
print(s)

### FIXED CODE ###

a,b = map(int,input().split())
s = ''
if a> b:
    for i in range(a):
        s = s+str(b)
else:
    for i in range(b):
        s = s+str(a)
print(s)
s = input()

l = 0
r = len(s)-1
cnt = 0

while l < r:
    lx = 0
    while s[l] == "x":
        lx += 1
        l += 1

    rx = 0
    while s[r] == "x":
        rx += 1
        r -= 1

    if s[l] == s[r]:
        cnt += abs(rx-lx)

        l += 1
        r -= 1
    else:
        cnt = -1
        break

print(cnt)

### FIXED CODE ###

s = input()

l = 0
r = len(s)-1
cnt = 0

while l < r:
    lx = 0
    while s[l] == "x" and l < len(s)-1:
        lx += 1
        l += 1

    rx = 0
    while s[r] == "x" and r > 0:
        rx += 1
        r -= 1

    if s[l] == s[r]:
        cnt += abs(rx-lx)

        l += 1
        r -= 1
    else:
        cnt = -1
        break

print(cnt)
data = {}
total = 0
N = int(input())

for a in input().split():
    a = int(a)
    data[a] = data.get(a, 0) + 1
    total += a

Q = int(input())

for _ in range(Q):
    b, c = map(int, input().split())
    diff = c - b
    count = data.get(b)
    total += diff * count
    if count: data[c] = data.get(c, 0) + data.pop(b)
    print(total)

### FIXED CODE ###

data = {}
total = 0
N = int(input())

for a in input().split():
    a = int(a)
    data[a] = data.get(a, 0) + 1
    total += a

Q = int(input())

for _ in range(Q):
    b, c = map(int, input().split())
    diff = c - b
    count = data.get(b)
    if count:
        data[c] = data.get(c, 0) + data.pop(b)
        total += diff * count
    print(total)
import math
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
A,B=map(int,input().split())
print(lcm(A, B))

### FIXED CODE ###

import math
def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return a
def lcm(x, y):
    return (x * y) // gcd(x, y)
A,B=map(int,input().split())
print(lcm(A, B))
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7

a, b, c = MAP()
d = a % b
if c % d == 0:
    print('YES')
else:
    print('NO')

### FIXED CODE ###

def gcd(x, y):
    if x < y:
        x, y = y, x
    while y > 0:
        x, y = y, x % y
    return x

a,b,c = map(int,input().split())
if a == b:
    if c % a == 0:
        print('YES')
    else:
        print('NO')
else:
    if c % gcd(a, b) == 0:
        print('YES')
    else:
        print('NO')
import sys
for l in sys.stdin:
    a,b,c,d,e,f = map(float, l.split())
    x = (c*e -f*b) / (a*e - d*b)
    y = (f - d*x) / e
    print "%.3f %.3f" %(x, y)

### FIXED CODE ###

import sys
for l in sys.stdin:
    a,b,c,d,e,f=map(float,l.split())
    x=a*e-b*d
    print"%0.3f %0.3f"%(c*e/x-b*f/x,a*f/x-c*d/x)
s=list(input())
divide=["dream","erase","eraser","dreamer"]
def dfs(n):
        if n==len(s):return True
        for i in divide:
                if n+len(i)<=len(s):
                        if "".join(s[n:n+len(i)]):
                                if dfs(n+len(i)):return True
        return False
print("YES") if dfs(0) else print("NO")


### FIXED CODE ###

s=input().replace("eraser",",").replace("erase",",").replace("dreamer",",").replace("dream",",").replace(",","")
print("YES" if s=="" else "NO")
n = int(input())
s0 = input()
for i in range(1, n):
    s = input()
    if s < s0:
        s0 = s
print s0

### FIXED CODE ###

n = int(input())
s = []
for i in range(n):
    s.append(raw_input())
print min(s)
N=int(input())
A=list(map(int,input().split()))

Ap=[]
Am=[]
for a in A:
    if a >= 0:
        Ap.append(a)
    else:
        Am.append(a)

Ap=sorted(Ap)
Am=sorted(Am,reverse=True)

if len(Am)%2==0:
    Ams=-sum(Am)
    Aps=sum(Ap)
    ans=Ams+Aps
else:
    Ams=-sum(Am)+Am[0]
    Aps=sum(Ap)-Ap[0]
    tmp=Ap[0]+Am[0]
    if tmp<0:
        tmp=-tmp
    ans=Ams+Aps+tmp
        
print(ans)


### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))

Ap=[]
Am=[]
for a in A:
    if a >= 0:
        Ap.append(a)
    else:
        Am.append(a)

Ap=sorted(Ap)
Am=sorted(Am,reverse=True)


if len(Ap)==0:
    if len(Am)%2==0:
        ans=-sum(Am)
    else:
        ans=-sum(Am)+2*Am[0]
        
elif len(Am)%2==0:
    Ams=-sum(Am)
    Aps=sum(Ap)
    ans=Ams+Aps
else:
    Ams=-sum(Am)+Am[0]
    Aps=sum(Ap)-Ap[0]
    tmp=Ap[0]+Am[0]
    if tmp<0:
        tmp=-tmp
    ans=Ams+Aps+tmp
        
print(ans)
while True:
    H,W = [int(i) for i in input().split()]
    if H == W == 0:
        break
    for h in range(H):
        for w  in range(w):
            if (h+w) % 2 == 0 :
                print('#', end ='')
            elif
                print('.', end ='')
        print()
    print()

### FIXED CODE ###

while True:
    h, w = map(int,input().strip().split())
    if h == w == 0: break
    for y in range(h):
        print(''.join('#.'[(x + y) % 2] for x in range(w)))
    print()