Harryxun/stf_run huggingface dataset:
x = input().split()
s = input()
n = int(x[0])
a = int(x[1])
b = int(x[2])
c = int(x[3])
d = int(x[4])
 
 
kome_flag = False
santen_flag = False
 
b_s = s[a:]
 
if '...' in b_s:
  santen_flag = True
if not '##' in b_s:
  kome_flag = True
    
if not '#' in b_s:
  print('Yes')
else:
  if c < d:
  	if kome_flag:
    	print('Yes')
  	else:
    	print('No')
 
	if d < c:
  		if kome_flag and santen_flag:
    		print('Yes')
  		else:
    		print('No')

### FIXED CODE ###

x = input().split()
s = input()
n = int(x[0])
a = int(x[1])
b = int(x[2])
c = int(x[3])
d = int(x[4])
 
 
kome_flag = False # ##がないとTrue
santen_flag = False # ... があればTrue
 
a_s = s[a:c]
b_s = s[b:d]
 
 
if d < c:
  if '...' in s[b-2:d+1]:
    santen_flag = True
kome_flag = True
if '##' in a_s or '##' in b_s:
  kome_flag = False
    

if True:
	if c < d:
		if kome_flag:
			print('Yes')
		else:
			print('No')
 
	if d < c:
		if kome_flag and santen_flag:
			print('Yes')
		else:
			print('No')
while True:
  ( H, W) = [ int(i) for i in input().split() ]
  if H == W == 0: break
  for h in range(H): print( '#' * w)
  print()

### FIXED CODE ###

while True:
  ( H, W) = [ int(i) for i in input().split() ]
  if H == W == 0: break
  for h in range(H): print( '#' * W)
  print()
x,n = map(int,input().split())
nump = list(map(int,input().split()))
nump.sort()
x_ind = -1
nump_io = [0]*100
for i in range(n):
    nump_io[nump[i]-1] = 1
    if(nump[i]==x):
        x_ind = i
if(x_ind == -1):
    print(x)
else:            
    for i in range(1,50):
        if(list_io[(x-1)-i] == 0):
            print(x-i)
            break
        if(list_io[(x-1)+i] == 0):
            print(x+i)
            break



### FIXED CODE ###

x,n = map(int,input().split())
nump = list(map(int,input().split()))
nump.sort()
x_ind = -1
nump_io = [0]*103
for i in range(n):
    nump_io[nump[i]-1] = 1
    if(nump[i]==x):
        x_ind = i
if(x_ind == -1):
    print(x)
else:            
    for i in range(1,51):
        if(nump_io[(x-1)-i] == 0):
            print(x-i)
            break
        if(nump_io[(x-1)+i] == 0):
            print(x+i)
            break
# print(nump_io)
n,m,q=map(int,input().split())

a=[]
b=[]
c=[]
d=[]
for i in range(0,q):
    ay,by,cy,dy=map(int,input().split())
    a.append(ay)
    b.append(by)
    c.append(cy)
    d.append(dy)
s=0
smax=0
for i1 in range(0,11):
    for i2 in range(i1,11):
        for i3 in range(i2,11):
            for i4 in range(i3,11):
                for i5 in range(i4,11):
                    for i6 in range(i5,11):
                        for i7 in range(i6,11):
                            for i8 in range(i7,11):
                                for i9 in range(i8,11):
                                    for i10 in range(i9,11):
                                        s=0
                                        na=[i1,i2,i3,i4,i5,i6,i7,i8,i9,i10]
                                        for j in range(0,q):
                                            if na[b[j]]-na[a[j]]==c[j]:
                                                s+=d[j]
                                        if s>smax:
                                            smax=s



print(smax)

### FIXED CODE ###

import sys
n,m,q=map(int,input().split())


a=[]
b=[]
c=[]
d=[]
for i in range(0,q):
    ay,by1,cy,dy=map(int,input().split())
    a.append(ay)
    b.append(by1)
    c.append(cy)
    d.append(dy)
s=0
smax=-100

sys.setrecursionlimit(3000)



def dfs(h):
    global smax
    if len(h)==n+1:
        s=0
        for j in range(0,q):
            if h[b[j]]-h[a[j]]==c[j]:
                s+=d[j]
        if s>smax:
            smax=s

        return
    
    for i in range(0,m+1-h[len(h)-1]):
        
        h2=h[:]
        h2.append(h[len(h)-1]+i)
        dfs(h2)

sta=[1]
dfs(sta)
print(smax)
s = sum(list(map(int,input().split())))
print("bust" if s s>21 else "win")

### FIXED CODE ###

s = sum(list(map(int,input().split())))
print("bust" if s>21 else "win")
s = input()
l, count = [], 0
for i in s:
    if i=='>': count+=1
    else:
        if count: l.append(count)
        count = 0
if count: l.append(count); count = 0
j = 0
ans = []
if s[0]=='<':
    ans.append(0)
    for i in range(len(s)):
    if s[i]=='<': ans.append(ans[-1]+1)
    else:
        if l[j]==0: j+=1
        if ans[-1]>=l[j]:
            l[j]-=1
            ans.append(l[j])
                
        else:
            ans[-1]=l[j]
            l[j]-=1
            ans.append(l[j])
    print(sum(ans))

else:
    ans.append(l[j])
    l[j]-=1
    for i in range(len(s)):
    if s[i]=='<': ans.append(ans[-1]+1)
    else:
        if l[j]==0: j+=1
        if j<len(l):
            
            if ans[-1]>=l[j]:
                ans.append(l[j])
                l[j]-=1
                
                    
            else:
                ans[-1]=l[j]
                ans.append(l[j])
                l[j]-=1
                
        else: ans.append(0)
    print(sum(ans))


### FIXED CODE ###

s = input()
l, count = [], 0
for i in s:
    if i=='>': count+=1
    else:
        if count: l.append(count)
        count = 0
if count: l.append(count); count = 0
j = 0
ans = []
if s[0]=='<': ans.append(0)
else:
    ans.append(l[0])
    l[0]-=1

for i in range(len(s)):
    if s[i]=='<': ans.append(ans[-1]+1)
    else:
        if i==0: ans.append(ans[-1]-1); continue
        if l[j]==0: j+=1
        if ans[-1]>=l[j]:
            l[j]-=1
            ans.append(l[j])
                
        else:
            ans[-1]=l[j]
            l[j]-=1
            ans.append(l[j])
print(sum(ans))
#include<bits/stdc++.h>
using namespace std;

int main(){
	
	string a;
	cin>>a;
	int la = a.length();
	bool c=false,f=false;
	for(int i=0;i<la;i++){
		if(a[i] == 'C')c = true;
		if(a[i]=='F' && c)f=true; 
	}
	if(c&&f)cout<<"Yes";
	else cout<<"No";
	
}


### FIXED CODE ###

s=input();pd=0
for i in range(0,len(s)):
    if s[i]=='C':
        pd=1
    if s[i]=='F'and pd==1:
        print('Yes')
        pd=2
        break
if pd!=2:
    print('No')
a=int(input())
s=set(a)
i=1
while True:
  if a % 2==1:
    a = a * 3 + 1
  else:
    a = a//2
    
  if a in s:
    break
  s|={a}
  i+=1
print(i)

### FIXED CODE ###

a=int(input())
s={a}
i=1
while True:
  i+=1
  if a % 2==1:
    a = a * 3 + 1
  else:
    a = a//2
    
  if a in s:
    break
  s|={a}
print(i)
a=sorted(list(map(int,input().split())))
if  a[0]==a[1]:
	if a[1] == a[2]:
		print("No")
	else:
		print("Yes")
else:
	if a[2] == a[3]:
		print("Yes")
	else:
		print("No")


### FIXED CODE ###

a=sorted(list(map(int,input().split())))
if  a[0]==a[1]:
	if a[1] == a[2]:
		print("No")
	else:
		print("Yes")
else:
	if a[1] == a[2]:
		print("Yes")
	else:
		print("No")
N = input()

answer = 1000 - (N%1000)

print(answer)

### FIXED CODE ###

N = int(input())

answer = 1000 - (N%1000)
answer = answer%1000

print(answer)
a, b = list(map(int, input().split()))
x, y = input().split('-')
print('Yes') if a==len(x) and b==len(y) else print('No')

### FIXED CODE ###

a, b = list(map(int, input().split()))
try:
    x, y = input().split('-')
    print('Yes') if a==len(x) and b==len(y) else print('No')
except:
    print('No')
N = input()
data = list(map(int(input().split()))
            
print (11)

### FIXED CODE ###

import math

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


BIG = pow(10,9)+7

dp = [BIG]*(N+1)

dp[0] = 0

for i in range(N):
    for j in range(i+1,i+3):
        if j<N:
            dp[j] = min(dp[j], dp[i] + abs(data[i]-data[j]))
            
print(dp[N-1])
import sys
n = int(input())
d = list(map(int, input().split()))
m = {}
ans = 1

if d[0] != 0:
    print(0)
    sys.exit()

for i in range(n):
    num = d[i]
    if num in m:
        m[num] += 1
    else:
        m[num] = 1

#print(m)
#print(max(m))

#for i in range(1, max(m)+1):
for i in range(0, max(m)):
    prevCnt = m[i]
    curCnt = m[i+1]
    ans *= prevCnt ** curCnt

print(ans)







### FIXED CODE ###

import sys
n = int(input())
d = list(map(int, input().split()))
m = {}
ans = 1

if d[0] != 0:
    print(0)
    sys.exit()

if d.count(0) > 1:
    print(0)
    sys.exit()

for i in range(n):
    num = d[i]
    if num in m:
        m[num] += 1
    else:
        m[num] = 1

# if len(m) < n:
#     print(0)
#     sys.exit()

#print(m)
#print(max(m))
maxV = max(m.keys())

#for i in range(1, max(m)+1):
#for i in range(0, max(m)):
for i in range(0, maxV):
    if i not in m or i + 1 not in m:
        print(0)
        sys.exit()
    prevCnt = m[i]
    curCnt = m[i+1]
    # prevCnt = m[i] % 998244353
    #curCnt = m[i+1] % 998244353
    ans *= prevCnt ** curCnt
    #ans *= (prevCnt ** curCnt) % 998244353

print(ans % 998244353)
while True:
    flag = 0
    line = input().split()
    h = int(line[0])
    w = int(line[1])
	
    if h == 0 and w == 0:
        break
	
    for i in range(h):
        if i % 2 == 0:
            for j in range(w):
                if(j%2==0):
		    print("#",end='')
                else:
                    print(".",end='')
        else:
            for j in range(w):
                if(j%2==0):
                    print(".",end='')
                else:
                    print("#",end='')
        print()


### FIXED CODE ###

while True:
	flag = 0
	line = input().split()
	h = int(line[0])
	w = int(line[1])
	
	if h == 0 and w == 0:
		break
	
	for i in range(h):
		if i % 2 == 0:
			for j in range(w):
				if(j%2==0):
					print("#",end='')
				else:
					print(".",end='')
		else:
			for j in range(w):
				if(j%2==0):
					print(".",end='')
				else:
					print("#",end='')
		print()
	print()
N=int(input())
V=list(map(int,input().split()))
C=list(map(int,input().split()))
ans=0
a=V[i]-C[i]
for i in range(N):
  if a>0:
    ans+=a
print(ans)    

### FIXED CODE ###

N = int(input())
V = list(map(int,input().split()))
C = list(map(int,input().split()))
ans = 0
for i in range(N):
  if V[i]-C[i] > 0:
    ans += V[i]-C[i]
print(ans)
count = int(input())

data = list(map(int,input().split()))

total = 0

for i in range(count):
    a =data.count(i + 1)
    print(a)
    if total + a+1 == count:
        print("0 \n" *(count - i))
        break

### FIXED CODE ###

import math

r = int(input())

print(r * 2 * math.pi)
oteage

### FIXED CODE ###

n=int(input())
mod=10**9+7
memo=[{} for i in range(n+1)]

def ok(last4):
  for i in range(4):
    t=list(last4)
    if i>=1:
      t[i-1],t[i]=t[i],t[i-1]
    if "".join(t).count("AGC")>=1:
      return False
  return True

def dfs(cur,last3):
  if last3 in memo[cur]:
    return memo[cur][last3]
  if cur==n:
    return 1
  res=0
  for c in "ACGT":
    if ok(last3+c):
      res=(res+dfs(cur+1,last3[1:]+c))%mod
  memo[cur][last3]=res
  return res

print(dfs(0,"TTT"))
N,A=map(int,input().split())
if N%500<A:
  print('Yes')
else:
  print('No')


### FIXED CODE ###

N=int(input())
A=int(input())
if N%500<=A:
  print('Yes')
else:
  print('No')
n=int(inut())
t,a=map(int,input().split())
l=list(map(int,input().split()))
for i in range(n):
    l[i]=abs(a-(t-l[i]*0.006))
print(l.index(min(l))+1)

### FIXED CODE ###

n=int(input())
t,a=map(int,input().split())
l=list(map(int,input().split()))
for i in range(n):
    l[i]=abs(a-(t-l[i]*0.006))
print(l.index(min(l))+1)
def draw_map(count_map, row_index, col_index) :
	for i in range(row_index-1, row_index+2) :
		if (i < 0 or len(count_map) <= i) :
			continue
		for j in range(col_index-1, col_index+2) :
			if (j < 0 or len(count_map[0]) <= j) :
				continue
			count_map[i][j] += 1
	
	return count_map
    				
    			

H,W = [int(i) for i in input().split()]
mines = []
for i in range(H) :
	mines.append(input())

# 白地図を用意して、1ずつ足す
# 空きマスだったら数字に置き換える
count_map = [[0 for i in range(W)] for j in range(H)]
for i in range(H) :
	for j in range(W) :
		if (mines[i][j] == "#") :
			mine_map = draw_map(count_map,i,j)

for i in range(H) :
	out_line = ""
	for j in range(H) :
		if (mines[i][j] == ".") :
			out_line += str(count_map[i][j])
		else :
			out_line += "#"
	print(out_line)
    		


### FIXED CODE ###

def draw_map(count_map, row_index, col_index) :
	for i in range(row_index-1, row_index+2) :
		if (i < 0 or len(count_map) <= i) :
			continue
		for j in range(col_index-1, col_index+2) :
			if (j < 0 or len(count_map[0]) <= j) :
				continue
			count_map[i][j] += 1
	
	return count_map
    				
    			

H,W = [int(i) for i in input().split()]
mines = []
for i in range(H) :
	mines.append(input())

# 白地図を用意して、1ずつ足す
# 空きマスだったら数字に置き換える
count_map = [[0 for i in range(W)] for j in range(H)]
for i in range(H) :
	for j in range(W) :
		if (mines[i][j] == "#") :
			mine_map = draw_map(count_map,i,j)

for i in range(H) :
	out_line = ""
	for j in range(W) :
		if (mines[i][j] == ".") :
			out_line += str(count_map[i][j])
		else :
			out_line += "#"
	print(out_line)
import numpy as np
N,M=map(int, input().split())

A=[]
for i in range(N):
    a=list(input())
    A.append(a)

B=[]
for i in range(M):
    b=list(input())
    B.append(b)

An=np.array(A)
Bn=np.array(B)

t=0
for i in range(N):
    for j in range(N):
        if Bn in An[i:i+M,j:j+M]:
            t=1
            break

if t==1:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

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

A=[list(input()) for i in range(N)]
B=[list(input()) for i in range(M)]




flag=0
for i in range(N-M+1):
    for j in range(N-M+1):
        for t in range(M):
            for s in range(M):
                if A[i+t][j+s]==B[t][s]:
                    flag+=1
        if flag==M*M: break
        else: flag=0
    if flag==M*M: break

if flag==0: print("No")
else: print("Yes")
n, k = map(int, input().split())
a = list(map(int, input().split()))

visited = [1]
is_visited = [0] * n
now = 1
step = 0
for i in range(k):
    now = a[now-1]
    step += 1

    if is_visited[now-1] == 0:
        is_visited[now-1] = 1
    else:
        ind = visited.index(now)
        loop = visited[ind:]
        tmp = (k-step) % len(loop)
        now = loop[tmp]
        break

print(now)


### FIXED CODE ###

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

a = list(map(int, input().split()))

visited = [1]
is_visited = [0] * n
now = 1
step = 0
for i in range(k):
    now = a[now-1]
    step += 1
    if is_visited[now-1] == 0:
        is_visited[now-1] = 1
        visited.append(now)
    else:
        ind = visited.index(now)
        loop = visited[ind:]
        tmp = (k-step) % len(loop)
        now = loop[tmp]
        break

print(now)
n = int(input())
l = list(map(int,input().split()))
a = [0 for _ in range(26)]
for i in l:
  a[i-1]+=1
  
for i in range(n):
  print(a[i])
  

### FIXED CODE ###

n = int(input())
print(2*3.1415*n)
L, R = map(int, input().split())
L = L % 2019
R = R % 2019

num_list = list(range(L, R + 1))
num_list.sort()

if 1 in num_list and 673 in num_list:
    print(0)
else:
    print(num_list[0] * num_list[1])


### FIXED CODE ###

L, R = map(int, input().split())
if (L <= 673 <= R and R - L >= 3) or (R - L >= 673):
    print(0)
else:
    mods = []
    mods_append = mods.append
    for i in range(L, R):
        for j in range(i + 1, R + 1):
            m = (i * j) % 2019
            mods_append(m)
            if m == 2:
                break

    print(min(mods))
a,b,c,d = map(int,input().split())

if(b<c):print (0)
elif(b==c):
    if(b == 0):print(0)
    else:print(1)
else:
    start = a if a>c else c
    end = b if b<d else d
    print(end - start)



### FIXED CODE ###



def isPal(n):
    sum = 0
    while(n>0):
        rem = n % 10
        sum = (sum * 10) + rem
        n = n//10

    return sum

n = int(input().strip())

if(n == isPal(n)):print('Yes')
else:print('No')
# -*- coding: utf-8 -*-
from collections import deque
from pprint import pprint
import numpy as np
N, M = map(int, input().split())
p = list(map(int, input().split()))
xy = [list(map(int, input().split())) for _ in range(M)]

# graph = [[0 for _ in range(N)] for _ in range(N)]
graph = np.zeros((N,N), dtype=bool)
# visited = [0 for _ in range(N)]
visited = np.zeros((N, ), dtype=bool)

for x,y in xy:
    graph[x-1,y-1] = True
    graph[y-1,x-1] = True

def dfs(v):
    que = deque()
    vis_list = []
    visited[v] = True
    vis_list.append(v)
    que.append(v)
    while len(que) > 0:
        i = que.pop()   #深さ優先探索
        # i = que.popleft() #幅優先探索
        for n in range(N):
            if graph[i,n] == True and visited[n] == False:
                visited[n] = True
                vis_list.append(n)
                que.append(n)

    return vis_list

grps = []
for i in range(N):
    if visited[i] == False:
        grps.append(dfs(i))

ans = 0
for g_list in grps:

    if len(g_list) == 1:
        if g_list[0] == p[g_list[0]]-1:
            ans += 1
    else:
        tmp = set([])
        for i in g_list:
            tmp.add(p[i]-1)
        ans += len( set(g_list) & tmp)

print(ans)


### FIXED CODE ###

# -*- coding: utf-8 -*-
from collections import deque, defaultdict
N, M = map(int, input().split())
p = list(map(int, input().split()))
xy = [list(map(int, input().split())) for _ in range(M)]

graph = defaultdict(set)
visited = [False for _ in range(N)]

for x,y in xy:
    graph[x-1].add(y-1)
    graph[y-1].add(x-1)

def dfs(v):
    que = deque()
    vis_list = []
    visited[v] = True
    vis_list.append(v)
    que.append(v)
    while len(que) > 0:
        i = que.pop()   #深さ優先探索
        # i = que.popleft() #幅優先探索
        for n in list(graph[i]):
            if visited[n] == False:
                visited[n] = True
                vis_list.append(n)
                que.append(n)

    return vis_list

grps = []
for i in range(N):
    if visited[i] == False:
        grps.append(dfs(i))

ans = 0
for g_list in grps:
    if len(g_list) == 1:
        if g_list[0] == p[g_list[0]]-1:
            ans += 1
    else:
        tmp = set([])
        for i in g_list:
            tmp.add(p[i]-1)
        ans += len( set(g_list) & tmp)

print(ans)
n,*a=map(int,open(0).read().split())
m=6**8
c=[0]*m
p=[1,1]+c[:]
for i in range(m):
  if p[i]<1:
    for j in range(i,m,i):p[j]=i
for a in a:
  c[a]+=1
  while p[a]!=a:
    a//=p[a]
    c[a]+=1
1/(max(c[2:])<n)
print(('not','psaeitr'[max(c[2:])>1::2]+'wise')[max(c[2:])<n],'coprime')

### FIXED CODE ###

n,*a=map(int,open(0).read().split())
m=6**8
c=[0]*m
p=[1,1]+c[:]
for i in range(m):
  if p[i]<1:
    for j in range(i,m,i):p[j]=i
for a in a:
  s={a}
  while a!=p[a]:
    s|={p[a]}
    a//=p[a]
    s|={a}
  for i in s:c[i]+=1
print(('not','psaeitr'[max(c[2:])>1::2]+'wise')[max(c[2:])<n],'coprime')
import copy
import queue

H, W = map(int, input().split())
A = [list('#' * (W + 2))]
q = queue.Queue()
for _ in range(H):
    a = input()
    A.append(list('#' + a + '#'))
A.append(list('#' * (W + 2)))
B = copy.deepcopy(A)
dx = [-1, 0, 1, 0]
dy = [0, -1, 0, 1]

for i in range(1, H + 1):
    for j in range(1, W + 1):
        if A[i][j] == '#':
            q.put([i, j])
q.put([])

ans = 0
count = 0
while not q.empty():
    count = 0
    p = q.get()
    if p == []:
        ans += 1
        A = copy.deepcopy(B)
        if not q.empty():
            q.put([])
    else:
        for k in range(4):
            y = p[1] + dy[k]
            x = p[0] + dx[k]
            if A[y][x] == '.':
                B[y][x] = '#'
                q.put([y, x])

print(ans - 1)


### FIXED CODE ###

from collections import deque


H, W = map(int, input().split())
A = [list('#' * (W + 2))]
q = deque()
A_append = A.append
q_append = q.append
for _ in range(H):
    a = input()
    A_append(list('#' + a + '#'))
A.append(list('#' * (W + 2)))
dx = [-1, 0, 1, 0]
dy = [0, -1, 0, 1]

for i in range(1, H + 1):
    for j in range(1, W + 1):
        if A[i][j] == '#':
            q_append([i, j, 0])

ans = 0

while len(q) != 0:
    p = q.popleft()
    for k in range(4):
        y = p[0] + dy[k]
        x = p[1] + dx[k]
        c = p[2]
        ans = max(ans, c)
        if A[y][x] == '.':
            A[y][x] = '#'
            q_append([y, x, c + 1])

print(ans)
def hoge(numbers):
  count = 1
  answer = []
  prev_number = number[0]
  for i, number in enumerate(numbers):
      if number == numbers[i-1] or count == 0:
        count += 1
      elif number != numbers[i-1]:
        asnwer.append(count)
        answer.append(number)
        count = 0
  return answer

while 1:
  N = input()
  number_list = hoge(map(int, raw_input().split()))
  for n in range(N - 1):
    number_list = hoge(number_list)
  for number in number_list:
    print number, 

### FIXED CODE ###

def f(a,n):
    for j in range(n):
        aa = ""
        s = a[0]
        c = 1
        for i in range(1,len(a)):
            if a[i] == s:
                c += 1
            else:
                aa += str(c) + s
                s = a[i]
                c = 1
        a = aa + str(c) + s
    return a
     
while 1:
    n = input()
    if n == 0: break
    a = raw_input()
    print f(a,n)
NM=list(map(int,input().split()))
person=[0 for i in range(NM[0])]
for i in range(NM[1]):
    d=input() 
    snack=list(map(int,input().split()))
    for i in snack:
        person[i-1]=1
d=0
for i in range(len(person)):
    if person[i]==0:
        d+=1
print(d)


### FIXED CODE ###

NM=list(map(int,input().split()))
H=list(map(int,input().split()))
A=[0 for i in range(NM[0])]
for i in range(NM[1]):
    ab=list(map(int,input().split()))
    A[ab[0]-1]=max(A[ab[0]-1],H[ab[1]-1])
    A[ab[1]-1]=max(A[ab[1]-1],H[ab[0]-1])
d=0
for i in range(NM[0]):
    if(H[i]>A[i]):
        d+=1
print(d)
import numpy as np
n, m  = map(int, input().split())

cards = np.array([])
for i in range(m):
    a, b = map(int, input().split())
    cards = np.append(cards, np.arange(a, b+1))
    
count = np.unique(cards, return_counts=True)
ans = sum(count[1] == m)
print(ans)

### FIXED CODE ###

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

a_max = -1
b_min = 999999999999999

for i in range(m):
    a, b = map(int, input().split())
    
    a_max = max(a_max, a)
    b_min = min(b_min, b)

ans = max(b_min - a_max + 1, 0)
print(ans)
n = input()
node = 0
tmp = n
while tmp:
	node += 1
	tmp >>= 1
edges = []
for i in range(node - 1):
	edges.append([i+1, i+2, 0])
	edges.append([i+1, i+2, 1<<i])
for i in range(node-2, -1, -1):
	if (1<<i)&n:
		edges.append([i+1, node, (n>>(i+1))<<(i+1)])
print node, len(edges)
for i in edges:
	print i[0], i[1], i[2]	

### FIXED CODE ###

n, k = map(int, raw_input().split())
if k%2:
	print (n/k)**3
else:
	cnt1, cnt2 = 0, 0
	for i in range(1, n + 1):
		if i%k == 0:
			cnt1 += 1
		if i%k == k/2:
			cnt2 += 1
	print cnt1**3 + cnt2**3
import math
A, B = map(int, input().split())

print(math.ceil((A -1) / (B - 1)))

### FIXED CODE ###

import math
A, B = map(int, input().split())

print(math.ceil((B -1) / (A - 1)))
n,m=map(int,input().split())
def num(x):
  if x<2:
    return 0
  else:
    return int(x*(x-1)/2)
 print(num(n)+num(m))

### FIXED CODE ###

n,m=map(int,input().split())
def num(x):
  if x<2:
    return 0
  else:
    return int(x*(x-1)/2)
print(num(n)+num(m))
def main():
    _ = int(input())
    A = list(map(int, input().split()))
    c = [0] * (4800 // 400)
    mx = 0
    for a in A:
        c[a // 400] = True
        if a >= 3200:
            mx += 1
    print(max(c[:3200 // 400].count(True), mx),
          c[:3200 // 400].count(True) + mx)


main()


### FIXED CODE ###

def main():
    _ = int(input())
    A = list(map(int, input().split()))
    c = [False] * (4800 // 400 + 1)
    d = [0] * (4800 // 400 + 1)
    for a in A:
        c[a // 400] = True
        d[a // 400] += 1
    mn = 1 if c[:8].count(True) == 0 else c[:8].count(True)
    mx = c[:8].count(True) + sum(d[8:])
    print(mn, mx)


main()
a=int(input())
b=int(input())

print((a-1)*(b-1))

### FIXED CODE ###

x,y = map(int,input().split())
print((x-1)*(y-1))
a,b,c=input().split()

for i in range(c)
	if a >= 1:
    	a -= 1
    elif b>= 1:
    	b -= 1
    else:

print(a b)
        

### FIXED CODE ###

a,b,c=map(int,input().split())
if a >= c:
  print(a-c,b)
else:
  print(0,max(a+b-c,0))
Row = int(input())
List = []
for i in range (Row):
  List.append(int(input()))
s = 1
res = 0
flag = False
for i in range(Row):
  s = List[s]
  res += 1
  if s == 2:
    flag=True
    break
if not flag:
  print(-1)
else:
  print(res)

### FIXED CODE ###

Row = int(input())
List = []
for i in range (Row):
  List.append(int(input()))
s = 1
res = 0
flag = False
for i in range(Row):
  s = List[s-1]
  res += 1
  if s == 2:
    flag=True
    break
if not flag:
  print(-1)
else:
  print(res)
x = input()
print(x*x*x)

### FIXED CODE ###


x = int(input())
print(x**3)