Harryxun/stf_run huggingface dataset:
a=input()
b=input()
if a>b:
   print("GREATER")
else if a<b:
    print("LESS")
else if a==b:
    print("EQUAL")

### FIXED CODE ###

a=int(input())
b=int(input())
if a>b:
   print("GREATER")
elif a<b:
    print("LESS")
elif a==b:
    print("EQUAL")
N=input()
a=list(map(int, input().split()))
b=a
c=1
if c<=N:
	d=a[c]
    b[d]=1
    c+=1
print(b)

### FIXED CODE ###

N=int(input())
a=list(map(int,input().split()))
ans=[0]*N
for i in range(N):
	b=a[i]-1
	ans[b]=i+1
for i in range(N):
	print(ans[i])
a = list(map(int, input().split()))
print(int(a[0]*(a[1]*100))/100)

### FIXED CODE ###

from decimal import Decimal

a,b = map(Decimal, input().split())
ans = a*b
print(int(ans))
#!/usr/bin/env python

if __name__ == "__main__":
    n,m = [int(i) for i in input().split(" ")]
    dic = {}
    same = 0
    a = [0] * n

    for i in range(m):
        tmp = [int(i) for i in input().split(" ")]

        if tmp[0] not in dic.keys():
            dic[tmp[0]] = tmp[1]
        else:
            if dic[tmp[0]] != tmp[1]:
                print("No")
                exit()

    for key in dic.keys():
        a[key] = dic[key]

    if a[0] == 0:
        print("No")
        exit()

    for i in a:
        print(i, end = "")

    print("")

### FIXED CODE ###

#!/usr/bin/env python

n, m = input().split(" ")
n = int(n)
m = int(m)
s_len = []
c_len = []
dig = 10**(n-1)

for i in range(m):
    tmp = input().split(" ")
    s_len.append(int(tmp[0]))
    c_len.append(int(tmp[1]))

for i in range(0, dig*10):
    flag = False
    if len(str(i)) < n:
        continue
    for j,s in enumerate(s_len):
        if str(i)[s-1] != str(c_len[j]) and flag == False:
            flag = True
            break
    if flag==False:
        print(i)
        exit()

print("-1")
N = int(input())
V = list(map(int, input().split()))
alist = []
tmp = 0

def cook(N, V):
    if N = 1
    print(V[0])
    
    else:
        V.sort()
        for i in range(0, N, 2):
            if i + 1 > N - 1:
                alist.append(V[i])
                
            else:
                tmp = (V[i] + V[i +1]) / 2
            alist.append(tmp)
            
        N = len(alist)
        cook(N, alist)
        
cook(N, V)

### FIXED CODE ###

N = int(input())
v = list(map(float, input().split()))

v.sort()

r = v[0]

for i in v[1::]:
    r = (r + i) / 2

print(r)
N = int(input())
S = int(input())

max = 0
x = 0

for i in range(N):
    if S[i] == 'I':
        x += 1
    else:
        x -= 1
    if x > max:
        max = x

print(max)


### FIXED CODE ###

N = int(input())
S = str(input())

max = 0
x = 0

for i in range(N):
    if S[i] == 'I':
        x += 1
    else:
        x -= 1
    if x > max:
        max = x

print(max)
n,k=map(int,input().split())
a=[]
def x(t,k):
  c=0
  while t<k:
    t*=2
    c+=1
  return c

for i in range(n):
  a.append(x(i+1),k)

ans=0
for i in range(k):
  ans=ans+1/n*(1/2)**k
print(ans)


### FIXED CODE ###

n,k=map(int,input().split())
a=[]
def x(t,k):
  c=0
  while t<k:
    t*=2
    c+=1
  return c

for i in range(n):
  a.append(x(i+1,k))

ans=0
for i in range(n):
  ans=ans+1/n*(1/2)**a[i]
print(ans)
A,B,C,K = map(int,input().split())
for a in range(A):
    if a == K:
        print(a)
        exit()
for b in range(B):
    if a+b == K:
        print(a)
        exit()
for c in range(C):
    if a+b+c == K:
        print(a-c)
        exit()

### FIXED CODE ###

A,B,C,K = map(int,input().split())
if A >= K:
    print(K)
elif A+B >= K:
    print(A)
else:
    print(2*A+B-K)
n, m = map(int, input().split())
a = [0] * m
b = [0] * m
first = {}
second = {}
for i in range(m):
    a[i], b[i] = map(int, input().split())
    if a[i] == 1:
        first.add(b[i])
    if b[i] == n:
        second.add(a[i])


ans = 'IMPOSSIBLE'
if first & second:
    ans = 'POSSIBLE'
print(ans)


### FIXED CODE ###

n, m = map(int, input().split())
a = [0] * m
b = [0] * m
first = set()
second = set()
for i in range(m):
    a[i], b[i] = map(int, input().split())
    if a[i] == 1:
        first.add(b[i])
    if b[i] == n:
        second.add(a[i])


ans = 'IMPOSSIBLE'
if first & second:
    ans = 'POSSIBLE'
print(ans)
import sys

a = []
for line in sys.stdin:
    a.append(line)

for n in a:
    num=int(n)
    x=0
    are=0
    while x<600:
         are+=(x**2)*num
         x+=num

print area

### FIXED CODE ###

import sys

a = []
for line in sys.stdin:
    a.append(line)

for n in a:
    num=int(n)
    x=0
    are=0
    while x<600:
         are+=(x**2)*num
         x+=num

    print are
# encoding: utf-8
import math, random
N, M = map(int, input().split())

def distribute(pos, full, tmp):
    return memo[tmp][pos]

def f1(x, c, n):
    return (x ** 2 + c) % n

def gcd(a, b):
    if b < 1: return a
    else: return gcd(b, a % b)

def pra(n, c):
    # print("######", n, c)
    if n % 2 == 0: return 2
    elif prime(n) == True: return n
    x = y = 2
    d = 1
    while d == 1:
        x = f1(x, c, n)
        y = f1(f1(y, c, n), c, n)
        d = gcd(n, int(math.fabs(x - y)))
    return pra(d, c + 1)
    
def jaeschke(n):
    d2s = n - 1
    for s in range(1, 32):
        if d2s % (2 ** (s + 1)) > 0: break
    d = d2s // (2 ** s)
    # print("###", n, d, s)
    for a in (2, 7, 61): 
        if (a ** d) % n == 1: continue
        for r in range(s):
            if (a ** (d * (2 ** r))) % n == n - 1: break
        else:
            return False
    else:
        return True

def prime(n):
    # print("####", n)
    if n == 2: return True
    elif n % 2 == 0: return False
    else: return jaeschke(n)

def pf(X):
    X_tmp = X
    ips = []
    c = 1
    for i in range(32):
        for c in range(1, 2):
            d = pra(X_tmp, c)
            if d > -1: break
        # print("##", X_tmp, d, c)
        for i_p in range(1, 32):
            if X_tmp % (d ** (i_p + 1)) > 0: break
        # print("#", X_tmp, d, i_p)
        X_tmp = X_tmp // (d ** i_p)
        ips.append(i_p)
        if X_tmp == 1: break
    else:
        # print("#", X_tmp, X_tmp, 1)
        ips.append(1)
    return ips

ips = pf(M)
    
#### O(NlogM) below ?
# create memo
## init
if len(ips) > 0: ip_max = max(ips)
else: ip_max = 0
memo = [[None] * N for i in range(ip_max + 1)] # max ip
for j in range(N): memo[0][j] = 1
for i in range(1, ip_max + 1): memo[i][N - 1] = 1
## fill
for i in range(1, ip_max + 1):
    sum_tmp = 0
    vals = list(memo[i - 1])[::-1]
    p_memo = memo[i]
    for j, val in enumerate(vals):
        sum_tmp += val
        p_memo[N - 1 - j] = sum_tmp
#### O(NlogM) above ?
        
# calculate ans
ans = 1
for i_p in ips: ans = (ans * distribute(0, i_p, i_p)) % (10 ** 9 + 7)

if M == 1: print(1)
elif ip_max < 1: print(N)
else: print(ans)

### FIXED CODE ###

# encoding: utf-8
import math
N, M = map(int, input().split())

ips = []
M_tmp = M
for p in range(2, int(math.sqrt(M)) + 1):
    if M_tmp % p > 0: continue
    for i_p in range(1, 33):
        if M_tmp % (p ** (i_p + 1)) > 0: break
    ips.append(i_p)
    M_tmp = M_tmp // (p ** i_p)
    if M_tmp == 1: break
else:
    ips.append(1)

#### O(NlogM) below ?
# create memo
## init
if len(ips) > 0: ip_max = max(ips)
else: ip_max = 0
memo = [[None] * N for i in range(ip_max + 1)] # max ip
for j in range(N): memo[0][j] = 1
for i in range(1, ip_max + 1): memo[i][N - 1] = 1
## fill
for i in range(1, ip_max + 1):
    sum_tmp = 0
    vals = list(memo[i - 1])[::-1]
    ptr_memo = memo[i]
    for j, val in enumerate(vals):
        sum_tmp += val
        ptr_memo[N - 1 - j] = sum_tmp
#### O(NlogM) above ?
        
# calculate ans
ans = 1
for i_p in ips:
    ans = (ans * memo[i_p][0]) % (10 ** 9 + 7)

if M == 1: print(1)
elif ip_max < 1: print(N)
else: print(ans)
price = int(input())
x = price // 100
y = price % 100
if y / x <= 5:
	val = 1
else:
  	val = 0
print(val)

### FIXED CODE ###

price = int(input())
x = price // 100
y = price % 100
if price < 100:
  	val = 0
elif y / x <= 5:
	val = 1
else:
  	val = 0
print(val)
N = int(input())
A = tuple(map(int, input().split()))
def p(n):
    is_prime = [True if i%2 == 1 else False for i in range(0, n+1) ]
    is_prime[0] = False
    is_prime[1] = False
    is_prime[2] = True # 2は素数
    for i in range(3, int(n**0.5) + 1, 2):
        if not is_prime[i]:
            continue
        # iの倍数は素数ではないとする
        for j in range(i*2, n+1, i):
            is_prime[j] = False
    return [i for i in range(n+1) if is_prime[i]]

primes = p(max(A))
fact_counts = dict()
for a in A:
    aa = a*a
    for p in primes:
        if p > aa:
            continue
        if a%p == 0:
            fact_counts.setdefault(p, 0)
            fact_counts[p] += 1
pairwise = True
for c in fact_counts.values():
    if c > 1:
        pairwise = False
        break

if pairwise:
    print('pairwise coprime')
else:
    if max(fact_counts.values()) == N:
        print('not coprime')
    else:
        print('setwise coprime')

### FIXED CODE ###

N = int(input())
A = tuple(map(int, input().split()))
maxa = max(A)
min_facts = [0] * (maxa+1)
def p(n):
    """ """
    is_prime = [True] * (n+1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, n+1):
        if not is_prime[i]:
            continue
        min_facts[i] = i
        
        for j in range(i*2, n+1, i):
            is_prime[j] = False
            if min_facts[j] == 0:
                min_facts[j] = i
p(maxa)
fact_counts = dict()
for a in A:
    while min_facts[a] > 0:
        f = min_facts[a]
        fact_counts.setdefault(f, 0)
        fact_counts[f] += 1
        while a%f == 0:
            a //= f

pairwise = True
for c in fact_counts.values():
    if c > 1:
        pairwise = False
        break

if pairwise:
    print('pairwise coprime')
else:
    if max(fact_counts.values()) == N:
        print('not coprime')
    else:
        print('setwise coprime')
h, w, m = map(int, input().split())

# l = np.array([0]*(h*w))
l = [0]*(h*w)

for _ in range(m):
    h_input, w_input = map(int, input().split())
    # print((h_input-1)*w+w)
    # print(list(map(lambda x: x+1, l[(h_input-1)*w:(h_input-1)+w])))

    l[(h_input-1)*w:(h_input-1)*w+w] = list(map(lambda x: x+1, l[(h_input-1)*w:(h_input-1)*w+w]))

    # l = list(map(lambda a,b: x + z, x,y))
#     l[(h_input-1)*w:(h_input-1)*w+w] += 1
    l[w_input-1::w] =  list(map(lambda x: x+1, l[w_input-1::w]))
    l[(h_input-1)*w+w_input-1] -= 1
print(max(l))
 


### FIXED CODE ###

h, w, m = map(int, input().split())

h_bomb = [0 for i in range(h)]
w_bomb = [0 for i in range(w)]
bomb_list = []

for i in range(m):
    hb, wb = map(int, input().split())
    h_bomb[hb-1] += 1
    w_bomb[wb-1] += 1
    bomb_list.append(tuple([hb, wb]))

h_bomb_max = max(h_bomb)
w_bomb_max = max(w_bomb)
h_bomb_line = []
w_bomb_line = []

for i in range(h):
    if h_bomb[i] == h_bomb_max:
        h_bomb_line.append(i)

for i in range(w):
    if w_bomb[i] == w_bomb_max:
        w_bomb_line.append(i)

bomb_set = set(bomb_list)

for i in h_bomb_line:
    for j in w_bomb_line:
        if (i+1, j+1) not in bomb_set:
            print(h_bomb_max+w_bomb_max)
            exit()

print(h_bomb_max + w_bomb_max -1)
S = input()
 
partial = ""
 
conditions = ["A","T","G","C"]
 
conlist = []
 
con = 0
 
for i in range(0,len(S)):
	if S[i] in conditions:
		for j in range(0,i+1):
			if S[j] in conditions:
				con +=1
			if (S[j] not in conditions) or j == i:
				conlist.append(con)
				con = 0
				
 
print(max(conlist))

### FIXED CODE ###

S = input()

partial = ""

conditions = ["A","T","G","C"]

conlist = []

con = 0

for i in range(0,len(S)):
	if S[i] in conditions:
		for j in range(0,i+1):
			if S[j] in conditions:
				con +=1
			if (S[j] not in conditions) or j == i:
				conlist.append(con)
				con = 0
				

if len(conlist) > 0:
	print(max(conlist))
else:print(0)
import numpy

inp=input().split(" ")
n=int(inp[0])
m=int(inp[1])
inh=input().split(" ")
for i in range(len(inh)):
  inh[i]=int(inh[i])
pairs=numpy.zeros(2*m,dtype=">i4").reshape(-1,2)
for i in range(m):
  a=input().split(" ")
  pairs[i][0]=int(a[0])
  pairs[i][1]=int(a[1])
lists=[[] for i in range(n)]
for i in range(len(pairs)):
  lists[pairs[i][0]-1].append(pairs[i][1])
  lists[pairs[i][1]-1].append(pairs[i][0])
for i in range(len(lists)):
  lists[i]=set(lists[i])
count=0
for i in range(len(lists)):
  if len(list[i])==0:
    count+=1
    continue
  for j in range(len(list[i])):
    if inh[i] <= inh[list[i][j]]:
      break
    if j == len(list[i])-1:
      count+=1
print(count)
  

### FIXED CODE ###

import numpy

inp=input().split(" ")
n=int(inp[0])
m=int(inp[1])
inh=input().split(" ")
for i in range(len(inh)):
  inh[i]=int(inh[i])
pairs=numpy.zeros(2*m,dtype=">i4").reshape(-1,2)
for i in range(m):
  a=input().split(" ")
  pairs[i][0]=int(a[0])
  pairs[i][1]=int(a[1])
lists=[[] for i in range(n)]
for i in range(len(pairs)):
  lists[pairs[i][0]-1].append(pairs[i][1]-1)
  lists[pairs[i][1]-1].append(pairs[i][0]-1)
for i in range(len(lists)):
  lists[i]=list(set(lists[i]))
count=0
for i in range(len(lists)):
  if len(lists[i])==0:
    count+=1
    continue
  for j in range(len(lists[i])):
    if inh[i] <= inh[lists[i][j]]:
      break
    if j == len(lists[i])-1:
      count+=1
print(count)
%%time
from collections import Counter

N = int(input())
S = input()

count_E = Counter(S)['E']
count_W = Counter(S)['W']

right = 0
left = count_E
tmp = N
for i in range(N):
    if right + left < tmp:
        tmp = right + left
    if S[i] == 'W':
        right += 1
    else:
        left -= 1
print(tmp)

### FIXED CODE ###

from collections import Counter

N = int(input())
S = input()

count_E = Counter(S)['E']
count_W = Counter(S)['W']

right = 0
left = count_E
tmp = N
for i in range(N):
    if S[i] == 'E':
        left -= 1
    if right + left < tmp:
        tmp = right + left
    if S[i] == 'W':
        right += 1
print(tmp)
n=int(input())
b=list(map(int,input().split()))
s_b=sorted(list(set(b)),reverse=True)
ans=[]
for itr in range(n):
  for j in s_b:
    if len(b)>=j:
      if b[j-1]==j:
        b.pop(j-1)
        ans.append(j)
        break
    if j==1:
      print(-1)
      exit()
ans.reverse()
for i in range(n):
  print(ans[i])


### FIXED CODE ###

n=int(input())
b=list(map(int,input().split()))
s_b=sorted(list(set(b)),reverse=True)
if 1 not in s_b:
  print(-1)
  exit()
ans=[]
for itr in range(n):
  for j in s_b:
    if len(b)>=j:
      if b[j-1]==j:
        b.pop(j-1)
        ans.append(j)
        break
    if j==1:
      print(-1)
      exit()
ans.reverse()
for i in range(n):
  print(ans[i])
n = int(input())
x = [0] * n
y = [0] * n
h = [0] * n
for i in range(n):
    x2, y2, h2 = map(int, input().split())
    x[i] = x2
    y[i] = y2
    h[i] = h2
ans = [0,0,0]
for i in range(101):
    for j in range(101):
        l = 0
        while h[l] == 0:
            l += 1
        #print(l)
        val = h[l] + abs(i-x[l]) + abs(j-y[l])
        flg = True
        for k in range(n):
            if val != h[k] + abs(i-x[k]) + abs(j-y[k]) and h[k] != 0:
                flg = False
            if h[0] == 0 and val != abs(i-x[k]) + abs(j-y[i]) and val - (i-x[k]) - (j-y[k]) == 0:
                flg == False
        if flg == True:
            ans = [i,j,val]
print(' '.join(map(str,ans)))


### FIXED CODE ###

n = int(input())
x = [0] * n
y = [0] * n
h = [0] * n
for i in range(n):
    x2, y2, h2 = map(int, input().split())
    x[i] = x2
    y[i] = y2
    h[i] = h2
ans = [0,0,0]
for i in range(101):
    for j in range(101):
        l = 0
        while h[l] == 0:
            l += 1
        #print(l)
        val = h[l] + abs(i-x[l]) + abs(j-y[l])
        flg = True
        for k in range(n):
            if val != h[k] + abs(i-x[k]) + abs(j-y[k]) and h[k] != 0:
                flg = False
            if h[k] == 0 and abs(i-x[k]) + abs(j-y[k]) < val:
                flg = False
        if flg == True:
            ans = [i,j,val]
print(' '.join(map(str,ans)))
n,k = map(int, input().split())
s = input()

pre = s[0]
cont = 1
for c in s[1:]:
  if c != pre:
    if c == s[0]:
      two += 1
    ans += cont-1
    cont = 1
  else:
    cont += 1
ans += cont-1

print(ans)      
  

### FIXED CODE ###

n, k = map(int, input().split())
s = input()

if n == 1:
    print(0)
    exit()

two = 0
pre = s[0]
cont = 1
ans = 0
for c in s[1:]:
    if c != pre:
        if c == s[0]:
            two += 1
        ans += cont - 1
        cont = 1
        pre = c
    else:
        cont += 1
ans += cont - 1

if s[0] != s[-1] and k > two:
    ans += 1
print(ans + 2 * min(k, two))
n = int(input())

if(n%10==3):
    print("bon")
else if(n%10 in [0, 1, 6, 8]):
    print("pon")
else:
    print("hon")


### FIXED CODE ###

n = int(input())

if(n%10==3):
    print("bon")
elif(n%10 in [0, 1, 6, 8]):
    print("pon")
else:
    print("hon")
c1, c2, c3 = map(list,map(int, [input() for i in range(3)]))
print(c1[0]+c2[1]+c3[2])

### FIXED CODE ###

c1, c2, c3 = map(list,map(str, [input() for i in range(3)]))
print(c1[0]+c2[1]+c3[2])
import os,re
from collections import Counter,deque
from operator import itemgetter
from itertools import accumulate,combinations
from sys import stdin,setrecursionlimit
from copy import deepcopy
import pysnooper
setrecursionlimit(10**6)

n=int(input())
cnt=0
for i in range(1,n+1):
    if len(str(i))%2==1:
        cnt+=1
print(cnt)

### FIXED CODE ###

import os,re
from collections import Counter,deque
from operator import itemgetter
from itertools import accumulate,combinations
from sys import stdin,setrecursionlimit
from copy import deepcopy
setrecursionlimit(10**6)

n=int(input())
cnt=0
for i in range(1,n+1):
    if len(str(i))%2==1:
        cnt+=1
print(cnt)
S = input()
List = ["Sunny", "Cloudy", "Rainy"]
print(List.index((List.index(S)+1)%3))

### FIXED CODE ###

S = input()
List = ["Sunny", "Cloudy", "Rainy"]
print(List[(List.index(S)+1)%3])
n=int(input())
a_list=list(map(int, input().split()))
a_list.sort()
 
a,b=a_list[:2][0], a_list[:2][1]
while 1:
  if a>b:
    a=a-b
  elif a<b:
    b=b-a
  elif a==b:
    print(a)
    break
n=int(input())
a_list=list(map(int, input().split()))
a_list.sort()

a,b=a_list[:2][0], a_list[:2][1]
while 1:
  if a>b:
    a=a-b
  elif a<b:
    b=b-a
  elif a==b:
    print(a)
    break


### FIXED CODE ###

import fractions
from functools import reduce
from sys import stdin
N = int(stdin.readline().rstrip())
A = [int(_) for _ in stdin.readline().rstrip().split()]
def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)
print(gcd_list(A))
A, B = map(int, input().split())
return A*B


### FIXED CODE ###

A, B = map(int, input().split())
print(A*B)
import sys

A = list(map(int, input().split()))
a, b = A[0], A[1]
kazu = 0
kuti = 1
while True:
    if kuti >= b:
        print(kazu)
        sys.quit()
    kazu += 1
    kuti = kuti - 1 + a

### FIXED CODE ###

import sys

A = list(map(int, input().split()))
a, b = A[0], A[1]
kazu = 0
kuti = 1
while True:
    if kuti >= b:
        print(kazu)
        sys.exit()
    kazu += 1
    kuti = kuti - 1 + a
s = input()
ans = 'No'
index = s.find(s[0], 1)
if index >= 1:
    s = s.replace(s[0], '')
    if (len(s) >= 2) & (s[0] == s[1]):
        ans ='Yes'
    
print(ans)

### FIXED CODE ###

s = input()
ans = 'No'
index = s.find(s[0], 1)
if index >= 1:
    s = s.replace(s[0], '')
    if (len(s) == 2):
        if (s[0] == s[1]):
            ans ='Yes'
    
print(ans)
s = input()
l = list(s)

count = 0
clist = []
n = (len(l))
for i in range(n):
    if l[i] in 'ACGT':
        count += 1
    else:
        clist.append(count)
        count = 0
        
print(max(clist))

### FIXED CODE ###

s = input()
l = list(s)

count = 0
clist = []
n = (len(l))
for i in range(n):
    if l[i] in 'ACGT':
        count += 1
        if i == n - 1:
            clist.append(count)
    else:
        clist.append(count)
        count = 0

print(max(clist))
# coding: utf-8
# Your code here!

N, M = map(int, input().rstrip().split(' '))

g = [[] for _ in range(N)]
for _ in range(M):
    x, y = map(int, input().rstrip().split(' '))
    g[y-1].append(x-1)
    
dp = [-1] * N
def rec(v):
    if dp[v] != -1:
        return dp[v]
        
    count = 0
    for x in g[v]:
        count = max(count, rec(x)+1)
        
    dp[v] = count
    
    return count
   
for i in range(N):
    rec(i)

print(max(dp))

### FIXED CODE ###

# coding: utf-8
# Your code here!

import sys
sys.setrecursionlimit(int(1e5))

N, M = map(int, input().rstrip().split(' '))

g = [[] for _ in range(N)]
for _ in range(M):
    x, y = map(int, input().rstrip().split(' '))
    g[y-1].append(x-1)
    
dp = [-1] * N
def rec(v):
    if dp[v] != -1:
        return dp[v]
        
    count = 0
    for x in g[v]:
        count = max(count, rec(x)+1)
        
    dp[v] = count
    
    return count
   
for i in range(N):
    rec(i)

print(max(dp))
A,B,C,D = (map(int,input.split()))

if B<C:
    res = 0
else:
    res = min(B,D) - max(A<C)
print(res)

### FIXED CODE ###

A,B,C,D = list(map(int,input().split()))


if A < C:
  a = C
else:
  a = A

if B < D:
  b = B
else:
  b = D
  
if B <= C or D <= A:
  res = 0
else:
  res = (b-a)
  
print(res)
import math
import decimal

a,b,h,m=map(float,input().split())
A=decimal.Decimal(a)
B=decimal.Decimal(b)
H=decimal.Decimal(h)
M=decimal.Decimal(m)
x=abs(((60*H+M)*0.5)-(6*M))
if x>=180:
    x=x-180
print(format((math.sqrt((A*A)+(B*B)-2*A*B*math.cos(math.radians(x)))),'.50f'))


### FIXED CODE ###

import math
 
A,B,H,M=map(int,input().split())
x=abs(((60*H+M)*0.5)-(6*M))
y=A**2+B**2-2*A*B*math.cos(math.radians(x))
print(math.sqrt(y))
N, M = map(int, input().split())
p = []
S = []
for i in range(M):
    pp, SS = map(str, input().split())
    p.append(pp)
    S.append(SS)

a = []
for i in range(M):
    a.append(int(p[i]))

AC = 0
P = 0

Q = []
R = []
for i in range(N):
    Q.append(0)
    R.append(0)

for i in range(M):
    index = a[i] - 1
    if Q[index] == 0 and S[i] == 'AC':
        AC = AC + 1
        Q[index] = 1
    elif Q[index] == 0 and S[i] == 'WA':
        R[i] = R[i] + 1

for i in range(N):
    if Q[i] == 0:
        P = 0
    else: P = P + R[i]

print(AC, P)

### FIXED CODE ###

N, M = map(int, input().split())
p = []
S = []
for i in range(M):
    pp, SS = map(str, input().split())
    p.append(pp)
    S.append(SS)

a = []
for i in range(M):
    a.append(int(p[i]))

AC = 0
P = 0

Q = []
R = []
for i in range(N):
    Q.append(0)
    R.append(0)

for i in range(M):
    index = a[i] - 1
    if Q[index] == 0 and S[i] == 'AC':
        AC = AC + 1
        Q[index] = 1
    elif Q[index] == 0 and S[i] == 'WA':
        R[a[i] - 1] = R[a[i] - 1] + 1

for i in range(N):
    if Q[i] == 0:
        P = P
    else: P = P + R[i]

print(AC, P)