Harryxun/stf_run huggingface dataset:
N, M = map(int, input().split(' '))

def fib(n):
    a, b = 0, 1
    for i in range(0, n):
        a, b = b, a + b
    return a

a_p = int(input())
sum = fib(a_p)
for i in range(M-1):
    a = int(input())
    diff = a - a_p
    if diff == 1:
        print('0')
        exit()
    sum *= fib(diff-1)
    sum %= 1000000007
    a_p = a

if (N - a_p == 1):
    print('0')
    exit()

sum *= fib(N - a_p)

print(sum % 1000000007)


### FIXED CODE ###

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

MOD = 1000000007

def fib(n):
    a, b = 0, 1
    for i in range(0, n):
        a, b = b, a + b
    return a

broken_step = []
p_a = -1
for i in range(M):
    a = int(input())
    if (a - p_a == 1):
        print("0")
        exit()
    else:
        p_a = a
    broken_step.append(a-1)

count_0 = 0
count_1 = 1
next_broken = 0
pre_is_broken = False
for i in range(N):
    if (next_broken >= len(broken_step) or i != broken_step[next_broken]):
        if (pre_is_broken):
            count_0 = 0
            pre_is_broken = False
        else:
            count_0, count_1 = count_1, count_0 + count_1
            count_0 %= MOD
            count_1 %= MOD
    else:
        next_broken+=1
        count_0 = 0
        pre_is_broken = True

print(count_1)
#include <bits/stdc++.h>
using namespace std;

int n;
int lim;
vector<string> A;

void f(int digitNum, string s){ 
    vector<bool> J(3, false);
    for(int i = 0; i < s.size(); i++){
        if(s[i] == '3') J[0] = true;
        if(s[i] == '5') J[1] = true;
        if(s[i] == '7') J[2] = true;
    }
    int idx = find(J.begin(), J.end(), false) - J.begin();
    if(idx == 3){
        A.push_back(s);
    }
    if(digitNum == lim){
        return;
    }
    f(digitNum + 1, s + '3');
    f(digitNum + 1, s + '5');
    f(digitNum + 1, s + '7');
    return;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    cin >> n;
    
    lim = to_string(n).length();
    
    if(lim < 3){
        cout << 0 << endl;
        return 0;
    }

    f(0, "");

    vector<int> B(A.size());
    for(int i = 0; i < A.size(); i++){
        B[i] = stoi(A[i]);
    }

    sort(B.begin(), B.end());

    int idx = lower_bound(B.begin(), B.end(), n) - B.begin();

    cout << idx + (B[idx] == n) << endl;

    return 0;
}

### FIXED CODE ###

A = []
str = "357"
lim = 11

def dfs(bef, sz):
    if sz + 1 == lim:
        return
    for i in str:
        t = bef + i
        A.append(t)
        dfs(t, sz + 1)

def main():
    n = int(input())

    dfs("", 0)

    ans = 0

    for a in A:
        q = False
        w = False
        e = False
        for i in a:
            if i == '3':
                q = True
            elif i == '5':
                w = True
            elif i == '7':
                e = True
        if q and w and e:      
            ai = int(a)
            if ai <= n:
                ans += 1

    print(ans)

main()
N = input()
cnt1 = 0
for x in N:
  if x == 'B':
    cnt1 += 1
N = N[::-1]
ans =  0
cnt2 = 0
for i in range(N):
  if N[i] == 'B':
    ans += i - cnt2
    cnt2 += 1
print(ans)

### FIXED CODE ###

N = input()
cnt1 = 0
for x in N:
  if x == 'B':
    cnt1 += 1
N = N[::-1]
ans =  0
cnt2 = 0
for i in range(len(N)):
  if N[i] == 'B':
    ans += i - cnt2
    cnt2 += 1
print(ans)
import math

a, b = input().split()

a = int(a)
b = int(b* 100)

print(math.floor(a*b/100))

### FIXED CODE ###

from decimal import *

a, b = map(Decimal, input().split())

print(int(a*b))
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
# from fractions import gcd
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 functools import reduce
from bisect import bisect_left, insort_left
from heapq import heapify, heappush, heappop
from scipy.special import comb

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))
ZIP = lambda: zip(*(MAP() for _ in range(n)))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def cmb(n, r):
    if n < 2: return 0
    if n - r < r: r = n - r 
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2, r+1):
        pivot = denominator[p-1]
        if pivot > 1:
            offset = (n - r)%p
            for k in range(p-1, r, p):
                numerator[k-offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result


def main():
    N = INT()
    A = LIST()

    c = Counter(A)
    l = [0 for _ in range(2 * (10**5) + 7)]
    h = [0 for _ in range(2 * (10**5) + 7)]

    for k, v in c.items():
        l[k] = cmb(v-1, 2)
        h[k] = cmb(v, 2)

    for a in A:
        ans = sum(h) - h[a] + l[a]
        print(ans) 


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
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 functools import reduce
from bisect import bisect_left, insort_left
from heapq import heapify, heappush, heappop

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def main():
    N = INT()
    A = LIST()

    C = Counter(A)

    X = 0
    for v in C.values():
        X += v * (v - 1) // 2

    for i in range(N):
        print(X - C[A[i]] + 1)


if __name__ == '__main__':
    main()
N = int(input())
A = list(map(int,input().split()))

count=-1
while len(A)==N:
    count+=1
    for i in range(N-1):
        if A[i]%2==0:
            A[i]=A[i]/2
        else:
            A.remove(A[i])
print(count)

### FIXED CODE ###

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

count=-1
while len(A)==N:
    count+=1
    for i in range(N):
        if A[i]%2==0:
            A[i]=A[i]/2
        else:
            A.remove(A[i])
            break
print(count)
R = input()
print(R * 3.1415)

### FIXED CODE ###

import sys
input = sys.stdin.readline

R = float(input().rstrip())
print(R * 2.0 * 3.1415)
N, Q = map(int, input().split())
2 S = input()
3 t=[0]*(N+1)
 4 for 5
6 for 7
8
i in range(N):
t[i + 1] = t[i] + (1 if S[i : i + 2] == 'AC' else 0)
i in range(Q):
l, r = map(int, input().split())
print(t[r-1] - t[l-1])

### FIXED CODE ###

N, Q = map(int, input().split())
S = input()
t=[0]*(N+1)
for i in range(N):
  t[i + 1] = t[i] + (1 if S[i : i + 2] == 'AC' else 0)
for i in range(Q):
  l, r = map(int, input().split())
  print(t[r-1] - t[l-1])
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
target = [list(map(int, input().split())) for i in range(M)]

'''
4 4
1 3
2 2
1 1
2 4


'''
A.sort()

tmp = []

for t in target:
    for i in range(t[0]):
        tmp.append(t[1])
tmp.sort(reverse=True)


#print(A)
#print(tmp)
for i,a in enumerate(A):
    if A[i] < tmp[i] and i < len(tmp) :
        A[i] = tmp[i]
        #print(A)
    else:
        break

print(sum(A))


### FIXED CODE ###

N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
target = [list(map(int, input().split())) for i in range(M)]
target = sorted(target, key = lambda x:x[1], reverse=True)
# print(target)

'''
4 4
1 3
2 2
1 1
2 4


'''


for t in target:
    A.extend([t[1]] * t[0])
    if len(A) > N * 2:
        break
A.sort(reverse=True)

print(sum(A[:N]))
from math import floor, ceil, sqrt, factorial, log, gcd
from itertools import accumulate, permutations, combinations, product, combinations_with_replacement
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict
from heapq import heappop, heappush, heappushpop
import copy
import numpy as np
import sys
INF = float('inf')
mod = 10**9+7


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

# 1 2 3
# a, b, c = LI()


def LI(): return list(map(int, sys.stdin.buffer.readline().split()))

# a = I()


def I(): return int(sys.stdin.buffer.readline())

# abc def
# a, b = LS()


def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()

# a = S()


def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')

# 2
# 1
# 2
# [1, 2]


def IR(n): return [I() for i in range(n)]

# 2
# 1 2 3
# 4 5 6
# [[1,2,3], [4,5,6]]


def LIR(n): return [LI() for i in range(n)]

# 2
# abc
# def
# [abc, def]


def SR(n): return [S() for i in range(n)]

# 2
# abc def
# ghi jkl
# [[abc,def], [ghi,jkl]]


def LSR(n): return [LS() for i in range(n)]

# 2
# abcd
# efgh
# [[a,b,c,d], [e,f,g,h]]


def SRL(n): return [list(S()) for i in range(n)]


def main():
    n = I()
    h = list(LI())
    n = int(input())
    ans = h[0]
    for i in range(1, n):
        if h[i] > h[i-1]:
            ans += h[i] - h[i-1]
    print(ans)


if __name__ == "__main__":
    main()


### FIXED CODE ###

from math import floor, ceil, sqrt, factorial, log, gcd
from itertools import accumulate, permutations, combinations, product, combinations_with_replacement
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict
from heapq import heappop, heappush, heappushpop
import copy
import numpy as np
import sys
INF = float('inf')
mod = 10**9+7


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

# 1 2 3
# a, b, c = LI()


def LI(): return list(map(int, sys.stdin.buffer.readline().split()))

# a = I()


def I(): return int(sys.stdin.buffer.readline())

# abc def
# a, b = LS()


def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()

# a = S()


def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')

# 2
# 1
# 2
# [1, 2]


def IR(n): return [I() for i in range(n)]

# 2
# 1 2 3
# 4 5 6
# [[1,2,3], [4,5,6]]


def LIR(n): return [LI() for i in range(n)]

# 2
# abc
# def
# [abc, def]


def SR(n): return [S() for i in range(n)]

# 2
# abc def
# ghi jkl
# [[abc,def], [ghi,jkl]]


def LSR(n): return [LS() for i in range(n)]

# 2
# abcd
# efgh
# [[a,b,c,d], [e,f,g,h]]


def SRL(n): return [list(S()) for i in range(n)]


def main():
    n = I()
    h = list(LI())
    ans = h[0]
    for i in range(1, n):
        if h[i] > h[i-1]:
            ans += h[i] - h[i-1]
    print(ans)


if __name__ == "__main__":
    main()
import math
n, d = map(int, input().split())
p = 0
for i in range(n):
  x, y = map(int, input().split())
  if sqrt(pow(abs(x),2)+pow(abs(y),2)) <= d :
    p += 1
print(p)

### FIXED CODE ###

from math import *
n, d = map(int, input().split())
p = 0
for i in range(n):
  x, y = map(int, input().split())
  if sqrt(pow(abs(x),2)+pow(abs(y),2)) <= d :
    p += 1
print(p)
numbers = [int(input()) for i in range(3)]

print(sum(numbers) + max(numbers)*9)

### FIXED CODE ###

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

print(sum(numbers) + max(numbers)*9)
if A == B:
    print(C)
elif A == C:
    print(B)
else:
    print(A)

### FIXED CODE ###

A,B,C = map(int,input().split())
if A == B: print(C)
elif B == C: print(A)
else: print(B)
N=(input())
print("Yes"if int(N)%(int(N[0])+int(N[1]))==0 else"No")

### FIXED CODE ###

N,A,B=map(int,input().split())
print(B if N*A>B else N*A )
A,B,C,D,E,F = list(map(int,input().split()))
A = 100*A
B = 100*B

a = int(F/A)
b = int(F/B)


hoge = 0

dp = [[0 for i in range(a+1)]for i in range(b+1)]
Na = [[0 for i in range(a+1)]for i in range(b+1)]
noudo = [[0 for i in range(a+1)]for i in range(b+1)]

for i in range(a+1):
    for j in range(b+1):
        if A*i+B*j < F:
            dp[i][j] = A*i+B*j
        c = int(E*dp[i][j]/(100*C))
        d = int(E*dp[i][j]/(100*D))
        for k in range(c+1):
            for m in range(d+1):
                if C*k+D*m <= F-dp[i][j]  and C*k+D*m < E*dp[i][j]/100:
                    Na[i][j] = max(Na[i][j],C*k+D*m)

for i in range(a+1):
    for j in range(b+1):
        if dp[i][j] != 0 and Na[i][j] != 0:
            noudo[i][j] = Na[i][j]/(dp[i][j]+Na[i][j])
        if hoge <= noudo[i][j]:
            res_i = i
            res_j = j
            hoge = noudo[i][j]

print(dp[res_i][res_j]+Na[res_i][res_j],Na[res_i][res_j])


### FIXED CODE ###

A,B,C,D,E,F = list(map(int,input().split()))
A = 100*A
B = 100*B

a = int(F/A)
b = int(F/B)

hoge = 0

water = [[0 for i in range(a+1)]for i in range(b+1)]
sugar = [[0 for i in range(a+1)]for i in range(b+1)]

noudo = [[0 for i in range(a+1)]for i in range(b+1)]

for i in range(a+1):
    for j in range(b+1):
        if A*i+B*j < F:
            water[j][i] = A*i+B*j
       


        c = int(E*water[j][i]/(100*C))
        d = int(E*water[j][i]/(100*D))
        for k in range(c+1):
            for m in range(d+1):
                if C*k+D*m <= F-water[j][i]  and C*k+D*m <= E*water[j][i]/100:
                    sugar[j][i] = max(sugar[j][i],C*k+D*m)

for i in range(a+1):
    for j in range(b+1):
        if water[j][i] != 0 and sugar[j][i] != 0:
            noudo[j][i] = sugar[j][i]/(water[j][i]+sugar[j][i])
        if hoge <= noudo[j][i]:
            res_i = i
            res_j = j
            hoge = noudo[j][i]

print(water[res_j][res_i]+sugar[res_j][res_i],sugar[res_j][res_i])
s = input()
t = input()

t1 = sorted(t,reverse=True)
s1 = sorted(s)

print(s1,t1)
hantei = 0
count = 0

for i in range(len(s1)):
    count += 1
    if t1[i] > s1[i]:
        hantei = 1
        break
    elif t1[i] < s1[i]:
        break
    elif count == len(s1):
        hantei = 1
        break

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

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

### FIXED CODE ###

s = input()
t = input()

t1 = sorted(t,reverse=True)
s1 = sorted(s)

hantei = 0
count = 0

if len(s1) < len(t1):
    for i in range(len(s1)):
        count += 1
        if t1[i] > s1[i]:
            hantei = 1
            break
        elif t1[i] < s1[i]:
            break
        elif count == len(s1):
            hantei = 1
            break

else :
     for i in range(len(t1)):
        if t1[i] > s1[i]:
            hantei = 1
            break
        elif t1[i] < s1[i]:
            break

if hantei == 1:
    print("Yes")
else:
    print("No")
dice = {v: k for k, v in enumerate(list(map(int, input().split())))}
adjacent = {k: v for k, v in enumerate(sorted(dice.keys()))}
q = int(input())
p = [(-1,2,4,1,3,-1),(3,-1,0,5,-1,2),(1,5,-1,-1,0,4),(4,0,-1,-1,5,1),(2,-1,5,0,-1,3),(-1,3,1,4,2,-1)]
for _ in range(q):
    top, front = map(int, input().split())
    x = dice[top]
    y = dice[front-1]
    print(adjacent[p[x][y])

### FIXED CODE ###

dice = {v: k for k, v in enumerate(list(map(int, input().split())))}
adjacent = {k: v for k, v in enumerate(sorted(dice.keys()))}
q = int(input())
p = [(-1,2,4,1,3,-1),(3,-1,0,5,-1,2),(1,5,-1,-1,0,4),(4,0,-1,-1,5,1),(2,-1,5,0,-1,3),(-1,3,1,4,2,-1)]
for _ in range(q):
    top, front = map(int, input().split())
    x = dice[top]
    y = dice[front]
    print(adjacent[p[x][y]])
str = input(.split(' '))

print(str[1]+str[0])

### FIXED CODE ###

s = str(input()).split(" ")
print(s[1] + s[0])
N,M=map(int,raw_input().split(' '))

g=[[False for i in range(N)] for j in range(N)]
ab=[()]*N
v=[False]*N

def dfs(n):
    v[n]=True
    for i in range(N):
        if g[n][i]==True and v[i]==False:
            dfs(i)

for i in range(M):
    a,b=map(int,raw_input().split(' '))
    a-=1
    b-=1
    g[a][b]=g[b][a]=True
    ab[i]=(a,b)

ans=0
for i in range(M):
    a,b=ab[i]
    g[a][b]=g[b][a]=False

    dfs(0)

    if v!=[True]*N:
        ans+=1

    g[a][b]=g[b][a]=True
    v=[False]*N

print ans



### FIXED CODE ###

a,b,c=map(int,raw_input().split(' '))

if a==b:
    print c
elif b==c:
    print a
else:
    print b
a = str(input.split())

a = int(a[:4]) + int(a[5:7]) + int(a[8:])

if (a > 20190430):
    print('TBD')
else:
    print('Heisei') 

### FIXED CODE ###

a = str(input())

a = a[:4] + a[5:7] + a[8:]

a = int(a)

if (a > 20190430):
    print('TBD')
else:
    print('Heisei')
alphabet=[chr(i+97) for i in range(0,26)]
S=input()

#S=    "zyawvutsrqponmlkjihgfedcbx"
if S=="zyxwvutsrqponmlkjihgfedcba":
    print(-1)
else:

    for i in S:
        alphabet.remove(i)
    if alphabet:
        print(S+alphabet[0])
    else:
        motoS=S
        S=list(S)
        poplist=[]
        stringlist=[]
        while len(S)>=2:
            poplist.append(S.pop())
            for s in poplist:
                _S=S
                _S[-1]=s
                string=""
                for ss in _S:
                    string+=ss
                stringlist.append(string)
        stringlist.append(motoS)
        stringlist.sort()
        print(stringlist[stringlist.index(motoS)+1])


### FIXED CODE ###

alphabet=[chr(i+97) for i in range(0,26)]
S=input()
if S=="zyxwvutsrqponmlkjihgfedcba":
    print(-1)
else:
    for i in S:
        alphabet.remove(i)
    if alphabet:
        print(S+alphabet[0])
    else:
        motoS=S
        S=list(S)
        poplist=[]
        stringlist=[]
        while len(S)>=2:
            poplist.append(S[-1])
            S.pop()
            for s in poplist:
                _S=[i for i in S]
                _S[-1]=s
                string=""
                for ss in _S:
                    string+=ss
                stringlist.append(string)
        stringlist.append(motoS)
        stringlist.sort()
        try:print(stringlist[stringlist.index(motoS)+1])
        except:print(stringlist[stringlist.index(motoS)])
import numpy as np

def wa (n):
    if n<=1:
        return 1
    else:
        return wa(n-1)+n

if __name__ == "__main__":
    n,k=map(int,input().split())
    a=list(map(int,input().split()))
    b=[]
    for i in a:
        b.append(wa(i)/i)
    b.sort(reverse=True)
    print(a,b)
    ans=0
    for i in range(3):

        ans+=b[i]
    print(ans)


### FIXED CODE ###

n,k=map(int,input().split())
a=list(map(int,input().split()))
b=[]
smax=0
for i in range(k-1,n):
    if i==k-1:
        sumnow=sum(a[:i+1])
    else:
        sumnow+=a[i]-a[i-k]
    smax=max(smax,sumnow)
print((smax+k)/2)
S = input()
if S[3]==S[4] and S[5]==S[6]:
  print "Yes"
else:
  print "No"

### FIXED CODE ###

S = input()
if S[2]==S[3] and S[4]==S[5]:
  print("Yes")
else:
  print("No")
S=input()
if S=ABC:
  print(ARC)
else:
  print(ABC)

### FIXED CODE ###

S=input()
if S=="ABC":
    print("ARC")
else:
    print("ABC")
n = int(input())
p = list(map(int, input().split()))
ans = 0
for i in range(n):
    if p[i] == i+1:
        p[i], p[i+1] = p[i+1], p[i]
        ans += 1
print(ans)

### FIXED CODE ###

n = int(input())
p = list(map(int, input().split()))
ans = 0
for i in range(n-1):
    if p[i] == i+1:
        p[i], p[i+1] = p[i+1], p[i]
        ans += 1
if p[n-1] == n:
    p[n-1], p[n-2] = p[n-2], p[n-1]
    ans += 1
print(ans)
def gcd(a,b):
  if a==b:
    return a 
  elif a<b:
    a,b=b,a
    while a%b!=0:
      a,b=b,a%b
    return b
  else:
    while a%b!=0:
      a,b=b,a%b
    return b
 

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

data_ans=[]
data1=[A[0]]
data2=[A[N-1]]
l=A[0]
m=A[N-1]
for i in range(1,N-3):
  l=gcd(l,A[i])
  m=gcd(m,A[N-i])
  data1.append(l)
  data2.append(m)
l=gcd(l,A[N-1])
m=gcd(m,A[1])
data_ans.append(l)
data_ans.append(m)
for i in range(0,N-3):
  data_ans.append(data1[i],data2[N-2-i])
print(max(data_ans))

### FIXED CODE ###

def gcd(a,b):
  if a==b:
    return a 
  elif a<b:
    a,b=b,a
    while a%b!=0:
      a,b=b,a%b
    return b
  else:
    while a%b!=0:
      a,b=b,a%b
    return b
 

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

data_ans=[]
data1=[A[0]]
data2=[A[N-1]]
l=A[0]
m=A[N-1]
for i in range(1,N-2):
  l=gcd(l,A[i])
  m=gcd(m,A[N-i-1])
  data1.append(l)
  data2.append(m)
l=gcd(l,A[N-2])
m=gcd(m,A[1])
data_ans.append(l)
data_ans.append(m)
for i in range(0,N-2):
  data_ans.append(gcd(data1[i],data2[N-3-i]))
print(max(data_ans))
if __name__ == "__main__":
  list_N_M = input().split(' ')
  N = int(list_N_M[0])
  M = int(list_N_M[1])
  
  list_str_H_all = input().split(' ')
  H = [0.0] * N
  for i in range(len(list_str_H_all)):
    H[i] = float(list_str_H_all[i])
  
  is_good_vp = [True] * N
  
  for _ in range(M):
    str_A_B = input().split(' ')
    A = int(str_A_B[0])
    B = int(str_A_B[1])
    
    if H[A-1] > H[B-1]:
      is_good_vp[B-1] = False
    elif H[B-1] > H[A-1]:
      is_good_vp[A-1] = False
    
  output = 0
  for i in rabge(N):
    if is_good_vp[i]:
      output += 1
      
  print(output)


### FIXED CODE ###

if __name__ == "__main__":
  list_N_M = input().split(' ')
  N = int(list_N_M[0])
  M = int(list_N_M[1])
  
  list_str_H_all = input().split(' ')
  H = [0] * N
  for i in range(len(list_str_H_all)):
    H[i] = int(list_str_H_all[i])
  
  is_good_vp = [True] * N
  
  for _ in range(M):
    str_A_B = input().split(' ')
    A = int(str_A_B[0])
    B = int(str_A_B[1])
    
    if H[A-1] > H[B-1]:
      is_good_vp[B-1] = False
    elif H[B-1] > H[A-1]:
      is_good_vp[A-1] = False
    else:
      is_good_vp[A-1] = False
      is_good_vp[B-1] = False
    
  output = 0
  for i in range(N):
    if is_good_vp[i]:
      output += 1
      
  print(output)
lst = list(input())
lst1 = []
lst1.append(lst[0]+lst[1])
lst1.append(lst[2]+lst[3])

if (int(lst1[0]) >=13 and int(lst1[1]) >=13) or (int(lst1[0]) >=13 and lst1[1] =="00") or (lst1[0] =="00" and lst1[1] >=13):
  print("NA")
  
elif (0<int(lst1[0])<=12 and 0<int(lst1[1])<=12):
      print("AMBIGUOUS")
      
elif 0<int(lst1[0]) <=12 and int(lst1[1])>=13:
      print("MMYY")
elif 0<int(lst1[1])<=12 and int(lst1[0])>=13:
      print("YYMM")

### FIXED CODE ###

lst = list(input())
lst1 = []
lst1.append(lst[0]+lst[1])
lst1.append(lst[2]+lst[3])

if (int(lst1[0]) >=13 and int(lst1[1]) >=13) or (int(lst1[0]) >=13 and lst1[1] =="00") or (lst1[0] =="00" and int(lst1[1]) >=13) or (lst1[0] =="00" and lst1[1] == "00"):
  print("NA")
  
elif (0<int(lst1[0])<=12 and 0<int(lst1[1])<=12):
      print("AMBIGUOUS")
      
elif 0<int(lst1[0]) <=12:
      print("MMYY")
elif 0<int(lst1[1])<=12:
      print("YYMM")
import sys
import numpy as np
sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline
X, Y, A, B, C = [int(x) for x in input().strip().split()]
p = np.array(sorted([int(x) for x in input().strip().split()], reverse=True))[:X]
q = np.array(sorted([int(x) for x in input().strip().split()], reverse=True))[:Y]
r = np.array(sorted([int(x) for x in input().strip().split()], reverse=True))[:min(C, X+Y)]

pq = np.hstack((p, q))
pq.sort()
ri = 0
for i, t in enumerate(pq):
    if t < r[ri]:
        pq[i] = r[ri]
        ri += 1
print(sum(pq))

### FIXED CODE ###

import sys
import numpy as np
sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline
X, Y, A, B, C = [int(x) for x in input().strip().split()]
p = np.array(sorted([int(x) for x in input().strip().split()], reverse=True))[:X]
q = np.array(sorted([int(x) for x in input().strip().split()], reverse=True))[:Y]
r = np.array(sorted([int(x) for x in input().strip().split()], reverse=True))[:min(C, X+Y)]

pq = np.hstack((p, q))
pq.sort()
ri = 0
for i, t in enumerate(pq):
    if t < r[ri]:
        pq[i] = r[ri]
        ri += 1
    if ri == len(r):
        break
print(sum(pq))