N = int(input()) a,b,c = map(int, input().split()) d,e,f = map(int, input().split()) def solve(x,y,z,n): high = N+10 low = 0 while low+1=2: w = y*(k-1)*x+y*z*(k-1)*(k-2)//2+(mid-(k-1)*y)*(x+(k-1)*z) else: w = mid*x if w>=n: high = mid else: low = mid return high n1 = solve(a,b,c,N) n2 = solve(d,e,f,N) if n1n2: print("KUPC") else: print("Same")