Harryxun/stf_run huggingface dataset:
import heapq
n, m, s, t = map(int, input().split())
INF = 10*20-1
data = []
for _ in range(m):
    data.append(list(map(int, input().split())))

check = [False] * (n-1)
graph = [[] for i in range(n+1)]

for i in range(m):
    graph[data[i][0]].append([data[i][1], data[i][2], data[i][3]])
    graph[data[i][1]].append([data[i][0], data[i][2], data[i][3]])
city_yen_cost = [INF] * (n+1)
city_yen_cost[s] = 0
queue = []
#[cost, vertex]
heapq.heappush(queue, [0, s])
count = 0
while count != n:
    now = heapq.heappop(queue)
    if check[now[1]]:
        continue
    else:
        count += 1
        check[now[1]] = True
        for path in graph[now[1]]:
            heapq.heappush(queue, [city_yen_cost[now[1]]+path[1], path[0]])




check = [False] * (n-1)
city_snuke_cost = [INF] * (n+1)
city_snuke_cost[t] = 0
queue = []
heapq.heappush(queue, [0, t])
count = 0
while count != n:
    now = heapq.heappop(queue)
    if check[now[1]]:
        continue
    else:
        count += 1
        check[now[1]] = True
        for path in graph[now[1]]:
            heapq.heappush(queue, [city_snuke_cost[now[1]]+path[2], path[0]])


for i in range(n+1):
    city_yen_cost[i] += city_snuke_cost[i]
for i in range(n):
    city_yen_cost[-i-2] = min(city_yen_cost[-i-2], city_yen_cost[-i-1])
for i in range(n):
    print(10**15-city_yen_cost[i+1])


### FIXED CODE ###

import heapq
n, m, s, t = map(int, input().split())
INF = 2**63-1
data = []
for _ in range(m):
    data.append(list(map(int, input().split())))

check = [False for i in range(n+1)]
graph = [[] for i in range(n+1)]

for i in range(m):
    graph[data[i][0]].append([data[i][1], data[i][2], data[i][3]])
    graph[data[i][1]].append([data[i][0], data[i][2], data[i][3]])
city_yen_cost = [INF for i in range(n+1)]
city_yen_cost[s] = 0
queue = []
#[cost, vertex]
heapq.heappush(queue, [0, s])
while len(queue) > 0:
    now = heapq.heappop(queue)
    if check[now[1]]:
        continue
    else:
        check[now[1]] = True
        for path in graph[now[1]]:
            if city_yen_cost[now[1]]+path[1] < city_yen_cost[path[0]]:
                city_yen_cost[path[0]] = min(city_yen_cost[now[1]]+path[1], city_yen_cost[path[0]])
                if not check[path[0]]:
                    heapq.heappush(queue, [city_yen_cost[now[1]]+path[1], path[0]])




check = [False for i in range(n+1)]
city_snuke_cost = [INF for i in range(n+1)]
city_snuke_cost[t] = 0
queue = []
heapq.heappush(queue, [0, t])
while len(queue) > 0:
    now = heapq.heappop(queue)
    if check[now[1]]:
        continue
    else:
        check[now[1]] = True
        for path in graph[now[1]]:
            if city_snuke_cost[now[1]]+path[2] < city_snuke_cost[path[0]]:
                city_snuke_cost[path[0]] = min(city_snuke_cost[now[1]]+path[2], city_snuke_cost[path[0]])
                if not check[path[0]]:
                    heapq.heappush(queue, [city_snuke_cost[now[1]]+path[2], path[0]])


totalcost = [None] * (n+1)
for i in range(n+1):
    totalcost[i] = city_yen_cost[i] + city_snuke_cost[i]
for i in range(n):
    totalcost[-i-2] = min(totalcost[-i-2], totalcost[-i-1])
for i in range(n):
    print(10**15-totalcost[i+1])
N=int(input())
a=[]
for i in range(N):
    a.append(input())

import numpy as np
s=np.zeros(5)

for i in a:
    if i[0]=="M":
        s[0]+=1
    elif i[0]=="A":
        s[1]+=1
    elif i[0]=="R":
        s[2]+=1
    elif i[0]=="C":
        s[3]+=1
    elif i[0]=="H":
        s[4]+=1
    else:
        continue
b=np.unique(s)
c=0
if len(b)<3:
    print(0)
else:
    for i in range(0,3):
        for j in range(i+1,4):
            for k in range(j+1,5):
                c+=s[i]*s[j]*s[k]
    print(c)


### FIXED CODE ###

N=int(input())
print(int(N/3))
import math
N,D = map(int,input().split)
print(N/(D*2+1))

### FIXED CODE ###

import math
N,D = map(int,input().split())
print(math.ceil(N/(D*2+1)))
A, B, C = map(int,input())
print(max(0, C-(A-B)))

### FIXED CODE ###

A, B, C = map(int,input().split())
print(max(0, C-(A-B)))
from math import floor
from math import sqrt

def f(bb,nn):
    if(nn<bb): return nn
    else: return f(bb,floor(nn/bb))+(nn%bb)
        

n=int(input())
s=int(input())

if n==s:
    print(n+1)
    exit()
elif n<s:
    print(-1)
    exit()

for i in range(2,int(sqrt(n))):
    if s==f(i,n):
        print(i)
        exit()

ans=10**12
for i in range(1,int(sqrt(n))):
    tmpb=(n-s)/i+1
    if f(tmpb,n)==s: 
        tmpb=min(ans,tmpb)

if ans>=10**12:
    print(-1)
else:
    print(ans)



### FIXED CODE ###

from math import floor
from math import sqrt

def f(bb,nn):
    if(nn<bb): return nn
    else: return f(bb,floor(nn/bb))+(nn%bb)
        

n=int(input())
s=int(input())

if n==s:
    print(n+1)
    exit()
elif n<s:
    print(-1)
    exit()

for i in range(2,int(sqrt(n))+2):
    if s==f(i,n):
        print(i)
        exit()

for i in reversed(range(1,int(sqrt(n))+2)):
    if (n-s)%i == 0:
        tmpb=(n-s)//i+1
        if tmpb >= sqrt(n) and f(tmpb,n)==s: 
            print(tmpb)
            exit()
print(-1)
"""
8
4 23 75 0 23 96 50 100
"""

[0,75,0,96,50,100]

n = int(raw_input())
ais = map(int, raw_input().split(' ')) #set()
i = 0
while(i < len(ais) and ais[i] == 0): i+=1
ais = ais[i:]

r = [0]
for i in range(len(ais)):
	if (ais[i-1] if i-1 >= 0 else 0) <= ais[i] > (ais[i+1] if i+1 < len(ais) else 0): 
		r.append(ais[i])
	if (ais[i-1] if i-1 >= 0 else 0) >= ais[i] < (ais[i+1] if i+1 < len(ais) else +float('inf')): 
		if i:
			r.append(ais[i])

	
t = 0
for i in range(0,len(r),2):
	if i + 1 < len(r):
		u,v = r[i],r[i+1]
		t += v-u
print t if len(ais) > 1 else ais[0]

### FIXED CODE ###

"""
8
4 23 75 0 23 96 50 100
"""

n = int(raw_input())
ais = map(int, raw_input().split(' '))

def f(ais):
	r = [0]
	for i in range(len(ais)):
		## looking for max
		if len(r) % 2:	
			if (ais[i-1] if i-1 >= 0 else 0) <= ais[i] > (ais[i+1] if i+1 < len(ais) else 0): 
				r.append(ais[i])
		else:
		## looking for min
			if (ais[i-1] if i-1 >= 0 else 0) >= ais[i] < (ais[i+1] if i+1 < len(ais) else 1000): 
				r.append(ais[i])

	t = 0
	for i in range(0,len(r),2):
		if i + 1 < len(r):
			u,v = r[i],r[i+1]
			t += v-u
	
	return t if len(ais) > 1 else ais[0]
print f(ais)
data = input().split()  
n = int(data[0])
m = int(data[1])
x = [int(s) for s in input().split()]

x.sort()

y=[]
tmp=0
for i in x:
    y.append(i-tmp)
    tmp=i

y.sort()
y.reverse()


res=x[-1]-x[0]


for i in range(n-1):
    res-=y[i]


print(res)

### FIXED CODE ###

data = input().split()  
n = int(data[0])
m = int(data[1])
x = [int(s) for s in input().split()]

x.sort()

y=[]
tmp=0
for i in x:
    y.append(i-tmp)
    tmp=i
y.pop(0)

y.sort()
y.reverse()

res=x[-1]-x[0]

if(len(y)+1 < n):
    n = len(y)+1

for i in range(n-1):
    res-=y[i]

print(res)
s=input()
if s[2]==s[3] ans s[4]==s[5]:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

s=input()
if s[2]==s[3] and s[4]==s[5]:
    print("Yes")
else:
    print("No")
ax, at = map(int, input().split(' '))
bx, bt = map(int, input().split(' '))
t = int(input())

a_l = ax + at*t
b_l = bx + bt*t

if a_l <= b_l:
	print("NO")
else:
	print("YES")

### FIXED CODE ###

name = input()
print(name[0:3])
def input_int():
    return(int(input()))

def input_int_list():
    return(list(map(int,input().split())))

def input_int_map():
    return(map(int,input().split()))

def run():
    num_count = input_int()
    nums = []
    for _ in range(num_count):
        nums.append(input_int())

    num_history = set(1)

    current_num = 1
    while True:
        current_num = nums[current_num - 1]

        if current_num == 1:
            print(-1)
            return

        if current_num == 2:
            print(len(num_history))
            return

        num_history.add(current_num)

run()


### FIXED CODE ###

def input_int():
    return(int(input()))

def input_int_list():
    return(list(map(int,input().split())))

def input_int_map():
    return(map(int,input().split()))

def run():
    num_count = input_int()
    nums = []
    for _ in range(num_count):
        nums.append(input_int())

    num_count = 1

    current_num = 1
    while True:
        current_num = nums[current_num - 1]

        if num_count >= len(nums):
            print(-1)
            return

        if current_num == 2:
            print(num_count)
            return
        num_count += 1

run()
import numpy as np
import copy
from itertools import product
h, w, k = map(int, input().split())
C = [list(input()) for _ in range(h)]
C = np.array(C)

cnt = 0
for i in product([True, False], repeat=h):
    c = copy.deepcopy(C)
    c = np.array(c)
    for p, q in enumerate(i):
        if q:
            c[p, :] = "$"
    for j in product([True, False], repeat=w):
        d = copy.deepcopy(c)
        d = np.array(d)
        for s,t in enumerate(j):
            if t:
                d[:, s] = "$"
        if np.count_nonzero(d == "#") == k:
            cnt += 1

print(cnt)

### FIXED CODE ###

import numpy as np
import copy
from itertools import product
h, w, k = map(int, input().split())
C = [list(input()) for _ in range(h)]
C = np.array(C)

cnt = 0
for i in product([True, False], repeat=h):
    c = copy.deepcopy(C)
    c = np.array(c)
    for p, q in enumerate(i):
        if q:
            c[p, :] = "$"
    for j in product([True, False], repeat=w):
        d = copy.deepcopy(c)
        d = np.array(d)
        for s,t in enumerate(j):
            if t:
                d[:, s] = "$"
        if np.count_nonzero(d == "#") == k:
            cnt += 1

print(cnt)
s = list(input())
int pattern_a_count = 0
int pattern_b_count = 0

for index, value in enumerate(s):
  if index % 2 =0:
    if value == "0":
      pattern_a_count += 1
  if index % 2 =1:
    if value == "1":
      pattern_a_count += 1
      
for index, value in enumerate(s):
  if index % 2 =0:
    if value == "1":
      pattern_b_count += 1
  if index % 2 =1:
    if value == "0":
      pattern_b_count += 1

### FIXED CODE ###

s = list(input())
pattern_a_count = 0
pattern_b_count = 0

# 1010パターン
for index, value in enumerate(s):
  if index % 2 == 0:
    if value == "0":
      pattern_a_count += 1
  if index % 2 == 1:
    if value == "1":
      pattern_a_count += 1

# 0101
for index, value in enumerate(s):
  if index % 2 == 0:
    if value == "1":
      pattern_b_count += 1
  if index % 2 == 1:
    if value == "0":
      pattern_b_count += 1
      
res = pattern_b_count
if pattern_a_count <= pattern_b_count:
  res = pattern_a_count
print(res)
a,b,c=map(int,input().split())
if a<= c and b=>c:
    print("Yes")
else:
    print("No")    


### FIXED CODE ###

# -*- coding: utf-8 -*-
a,b,c = list(map(int,input().split()))
if a <= c <=b :
    print("Yes")
else:
    print("No")
N = int(input())
L = list(map(int,input().split()))
L = sorted(L)
ln = len(L)
ansl = []
nonans = 0

for i in range(ln-2):
   for j in range(1,ln -1):
      for k in range(2, ln):
         if L[i] + L[j] > L[k] and L[i] != L[j] and L[j] != L[k] and L[k] != L[i]:
            ansl.append([L[i], L[j], L[k]])

for i in range(ln-1):
   for j in range(i + 1, ln):
      if ansl[i] == ansl[j]:
         nonans += 1
            

print(len(ansl) - nonans -1)

### FIXED CODE ###

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

L = sorted(L)

ln = len(L)

ans = 0

for i in range(ln-2):
   for j in range(i+1, ln-1):
      for k in range(j + 1, ln):
         if L[i] + L[j] > L[k] and L[i] != L[j] and L[j] != L[k]:
             ans += 1

print(ans)
# n, m, l = map(int, input().split())

# list_n = list(map(int, input().split()))

# n = input()
# list = [input() for i in range(N)

# list = [[i for i in range(N)] for _ in range(M)]

import sys
import itertools
import math
input = sys.stdin.readline

N = int(input())
list_P = tuple(map(int, input().split()))
list_Q = tuple(map(int, input().split()))

List_All = list(itertools.permutations(list(range(1, N+1))))
# print(List_All)
Pi = List_All.index(list_P)
Qi = List_All.index(list_Q)
print(abs(Pi-Qi))


### FIXED CODE ###

# n, m, l = map(int, input().split())

# list_n = list(map(int, input().split()))

# n = input()
# list = [input() for i in range(N)

# list = [[i for i in range(N)] for _ in range(M)]

import sys
input = sys.stdin.readline

MP = int(input())
M = 1
ans = 0

while MP > 1:
    ans += M
    M = 2*M
    MP = MP//2
ans += M

print(ans)
s = input()
alphabets = [0] * 26
for i in range(len(s)):
    x = ord(s[i])
    alphabets[x-97] += 1
flag = True
for x in alphabets:
    if x % 2 != 0:
        ok = False
if ok:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

s = input()
alphabets = [0] * 26
for i in range(len(s)):
  a = ord(s[i])
  alphabets[a-97] += 1
flag = True
for x in alphabets:
  if x % 2 != 0:
    flag = False
if flag:
  print('Yes')
else:
  print('No')
W,H,x,y,r=map(int,input().split())
if 0 < x + r <= W:
  if 0 < y + r <= H:
    print("Yes")
  else:
    Print("No")
else:
  print("No")

### FIXED CODE ###

W,H,x,y,r=map(int,input().split())
if r <= x and r <= y and x+r <= W and y+r <= H:
  print("Yes")
else:
  print("No")
n = int(input())
ab = []
x = 0
for i in range(n):
  a,b = map(int,input().split())
  x -= b
  ab.append(a+b)
ab.sort()
for i in range(raound(n/2)):
  x += ab[i]
print(x)

### FIXED CODE ###

n = int(input())
ab = []
x = 0
for i in range(n):
  a,b = map(int,input().split())
  x -= b
  ab.append(a+b)
ab.sort()
ab.reverse()
for i in range(n):
  if i%2==0:
      x+=ab[i]
print(x)
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

def main():
    n, x, d = MI()
    ad = abs(d)
    # 数列からk個選んだ和の範囲をkx mod dで分けて記録
    range_by_mod = [[None, None] for _ in range(ad)]
    ans = 0
    for k in range(n + 1):
        l = (k * (k - 1) * d // 2 + k * x) // ad
        r = ((2 * n - k - 1) * k * d // 2 + k * x) // ad
        if l > r: l, r = r, l
        pl, pr = range_by_mod[k * x % ad]
        if pl == None:
            range_by_mod[k * x % ad] = [l, r]
        else:
            if l <= pr:
                range_by_mod[k * x % ad][1] = r
            else:
                ans += pr - pl + 1
                range_by_mod[k * x % ad] = [l, r]
        #print(k, l, r, k * x % ad, ans)
        #print(range_by_mod)
    for l, r in range_by_mod:
        if l == None: continue
        ans += r - l + 1
    print(ans)

main()


### FIXED CODE ###

import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

# 総和は一定なので高橋君が何点(?)とるかの問題に置き換えられる
# d=0かつx=0のときは1、x!=0ならn+1で確定
# d,xと-d,-xは同値なので、dを正にすることで増加数列で考える
# d,xを同じ数で割っても答えは変わらないので、互いに素にする
def gcd(a, b):
    if b == 0: return a
    return gcd(b, a % b)

def main():
    n, x, d = MI()
    if d == 0:
        if x == 0:
            print(1)
        else:
            print(n + 1)
        exit()
    if d < 0: d, x = -d, -x
    g = gcd(d, abs(x))
    d, x = d // g, x // g
    #print(x, d)
    # aをk個選ぶと和sはs=k*x+c*dで、cは最小で0からk-1の和
    # 最大でn-kからn-1の和
    # kを固定するとs//dは1ずつの単調増加なので、最小と最大で個数が分かる
    # sはs mod d = x*k mod dが同じなので、それで分類する
    kk = list(range(n + 1))
    kk.sort(key=lambda k: (k * x % d, k))
    #print(kk)
    ans = 0
    pmd = -1
    pl, pr = 1, 0
    for k in kk:
        l = (k * x + (k - 1) * k // 2 * d) // d
        r = (k * x + (2 * n - k - 1) * k // 2 * d) // d
        md = x * k % d
        if md == pmd and l <= pr and pl<=r:
            pl,pr=min(pl,l),max(pr,r)
        else:
            ans += pr - pl + 1
            pl, pr = l, r
        pmd = md
        #print(k, l, r, pl, pr, ans)
    ans += pr - pl + 1
    print(ans)

main()
n = int(input())
p = map(int, input().split())
q = map(int, input().split())

import math

a=0
for i in range(n-1):
  a += (p[i]-1) * math.factorial(n-1-i)
  
b=0
for i in range(n-1):
  b += (p[i]-1) * math.factorial(n-1-i)
  
print( abs(a-b) )


### FIXED CODE ###

from itertools import permutations
n=int(input())
v=list(permutations(range(1,n+1),n))
print(abs(v.index(tuple(map(int,input().split())))-v.index(tuple(map(int,input().split())))))
inputs = input().split(" ")

print(math.ceil(inputs[2]/(inputs[0]+(inputs[1]/7))))


### FIXED CODE ###

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

days = int(C/(A+(B/7)))

while 1:
    coins = A* days + B * (days//7)

    if ( coins >= C):
        break
    else:
        days += 1

print(days)
a, b, x = map(int, input().split())
 
def Calprice(n):
  return a * n + b * len(str(n))
 
min = 0
max = 10 ** 9 + 1
 
while max - min > 1:
  dev = (max + min) // 2
  if Calprice(dev) > x:
    max = dev
  else:
    min = dev

print(min)
    

### FIXED CODE ###

N = int(input())
S = list(input())
res =[]
for s in S:
    if(ord(s) + N > 90):
        res.append(chr((ord(s)+N-26)))
    else:
        res.append(chr((ord(s)+N)))
print("".join(res))
import math
from scipy.special import comb

def comb(n, r, mod):
    num = 1
    denom = 1
    for i in range(r):
        denom = (denom * (i+1)) % mod
        num = (num * (n-i)) % mod
    return num*pow(denom, mod-2, mod)

n, a, b = map(int,input().split())

mod = 10**9 + 7

sum = pow(2, n, mod) - 1
sum -= comb(n, a, mod)
sum -= comb(n, b, mod)

print(int(sum % mod))


### FIXED CODE ###

def com(n, r, mod):
    num = 1
    denom = 1
    for i in range(r):
        denom = (denom * (i+1)) % mod
        num = (num * (n-i)) % mod
    return num*pow(denom, mod-2, mod)

n, a, b = map(int,input().split())

mod = 10**9 + 7

sum = pow(2, n, mod) - 1
sum -= com(n, a, mod)
sum -= com(n, b, mod)

print(int(sum % mod))
from math import sqrt
a,b,c=map(int,input().split())
if sqrt(a)+sqrt(b)<sqrt(c):
  print("Yes")
else:
  print("No")

### FIXED CODE ###

L=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(L[int(input())-1])
n, m = map(int, input().split())

if 0 < m:
    s_c = [0] * (m * 2)
    for i in range(m):
        s_c[2 * i], s[2 * i + 1] = map(int, input().split())
    

for i in range(0, m * 2 , 2):
    s_c[i] -= 1

num = [-1] * n
flag = False
for i in range(m):
    if num[s_c[2 * i]] != -1 and num[s_c[2 * i]] != s_c[2 * i + 1]:
        #print("diffrent")
        flag = True
    else:
        num[s_c[2 * i]] = s_c[2 * i + 1]
        
for i in range(n):
    if num[i] == -1:
        num[i] = 0
        
#print(num)
    
if 1 < n and num[0] == 0:
    #print("head is 0")
    flag = True

if flag:
    print(-1)
else:
    print(''.join([str(n) for n in num]))

### FIXED CODE ###

n, m = map(int, input().split())

s = [0] * m
c = [0] * m

for i in range(m):
    s[i], c[i] = map(int, input().split())
    s[i] -= 1
    
num = [10] * n

flag = False
for i in range(m):
    if num[s[i]] != 10 and num[s[i]] != c[i]:
        #print("dif")
        flag = True
    else:
        num[s[i]] = c[i]
        
if 1 < n and num[0] == 0:
    #print("head is 0")
    flag = True
elif 1 < n and num[0] == 10:
    num[0] = 1

for i in range(n):
    if num[i] == 10:
        num[i] = 0

if flag:
    print(-1)
else:
    print(''.join([str(n) for n in num]))
# coding: utf-8
 
n, m, x, y = map(int, input().split())
xn = list(map(int, input().split()))
ym = list(map(int, input().split()))

if x < y:
    for i in range(x, y+1):
        if max(xn) < i and min(ym)>=i:
            print("No War")
            break
        elif i == y:
            print("War")
else:
    print("War")

### FIXED CODE ###

# coding: utf-8
 
a, b, c = map(int, input().split())
 
x = a*10 + b
y = b*10 + c
z = c*10 + a
 
if x >= y and x >= z:
    print(x + c)
elif y >= x and y >= z:
    print(y + a)
else:
    print(z + b)
s = input()

l = len(s)
# print(l)
# print(s[0:1])
if l % 2 != 0:
    print("No")
else:
    for i in range(0, l, 2):
        if s[i:i+2] == "hi":
            # print(s[i:i+1])
        else:
            print("No")
            break
    print("Yes")

### FIXED CODE ###

s = input()
 
l = len(s)
 
if l % 2 != 0:
    print("No")
else:
    for i in range(0, l, 2):
        if s[i:i+2] == "hi":
            if i == l-2:
                print("Yes") 
            else:
                continue

        else:
            print("No")
            break
S = input()
T = input()
slide_num = len(S) - len(T)
if slide_num < 0:
    exit()
for slide in range(slide_num+1):
    for j in range(len(S)-slide):
        if S[j+slide] == T[j] or S[j+slide] == '?':
            None
        else:
            break
    else:
        print((S[:slide] + T + S[slide+len(T):]).replace('?', 'a'))
        exit()
print('UNRESTORABLE')

### FIXED CODE ###

S = input()
T = input()
L = []
slide_num = len(S) - len(T)
if slide_num < 0:
    print('UNRESTORABLE')
    exit()
for slide in range(slide_num+1):
    for j in range(len(T)):
        if S[j+slide] == T[j] or S[j+slide] == '?':
            None
        else:
            break
    else:
        L.append((S[:slide] + T + S[slide+len(T):]).replace('?', 'a'))

if L:
    print(L.pop())
else:
    print('UNRESTORABLE')
N = int(input())
H = list(list(map(int,input().split())) for _ in range(N))
#sub problem: max cost from 0 to ith day
def rec(i, choice):
  if i == len(H):
    return 0
  return max((H[i][j] + rec(i+1,j) for j in range(3) if j != choice), default=0)
print(max((rec(0, j) for j in range(3)), default=0))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10000000)
 
N = int(input())
H = list(list(map(int,input().split())) for _ in range(N))
#sub problem: max cost from 0 to ith day
memo = {}
def rec(i, choice):
  if (i, choice) in memo:
    return memo[(i, choice)]
  if i == len(H):
    return 0
  m = max(H[i][j] + rec(i+1,j) for j in range(3) if j != choice)
  memo[(i, choice)] = m
  return m
print(max(rec(0, j) for j in range(3)))
D,N = map(int,input().split()
print(100**D*N if N!=100 else 100**D*(N+1))

### FIXED CODE ###

D,N = map(int,input().split())
if(D==2):
  print(10000*N if N!=100 else 10000*(N+1))
elif(D==1):
  print(100*N if N!=100 else 100*(N+1))
else:
  print(N if N!=100 else N+1)
l = int(input(),16).split()

if l[0] < l[1]:
  print("<")
elif l[0] = l[1]:
  print ("=")
elif l[0] > l[1]:
  print(">")


### FIXED CODE ###

l = input().split()
l2 = [int(s, 16) for s in l]

if l2[0] < l2[1]:
  print("<")
elif l2[0] == l2[1]:
  print ("=")
elif l2[0] > l2[1]:
  print(">")
import numpy as np
l = [list(input()) for i in range(2)]
arr = np.array(l)
if arr == np.rot90(arr,k=2):
    print("YES")
else:
    print("NO")

### FIXED CODE ###

import numpy as np
l = [list(input()) for i in range(2)]
arr = np.array(l)
if np.all(arr == np.rot90(arr,k=2)):
    print("YES")
else:
    print("NO")
N=int(input())
l=[int(input()) for i in range(5)]

print(len(list(set(list))))

### FIXED CODE ###

N=int(input())
l=[int(input()) for i in range(N)]

print(len(list(set(l))))