Harryxun/stf_run huggingface dataset:
import math

A B H M = map(int, input().split())

H_arg = H*30 + 0.5*M
M_arg = 6*M

if H_arg - M_arg>=180:
    H_M_arg = (360-H_arg) + M_arg
else:
    H_M_arg = abs(H_arg - M_arg)

X = math.sqrt(A**2+B**2-2*A*B*cos(H_M_arg))
print(X)


### FIXED CODE ###

import math

A, B, H, M = map(int, input().split())

H_arg = H*30 + 0.5*M
M_arg = 6*M

if H_arg - M_arg>=180:
    H_M_arg = (360-H_arg) + M_arg
else:
    H_M_arg = abs(H_arg - M_arg)

# print(H_M_arg)

X = math.sqrt(A**2+B**2-2*A*B*math.cos(math.radians(H_M_arg)))
print(X)
from sys import exit, setrecursionlimit, stderr
from functools import reduce
from itertools import *
from collections import *
from bisect import *
from heapq import *

def read():
  return int(input())
 
def reads():
  return [int(x) for x in input().split()]

maxd = -1
ans = None

A, B, C, D, E, F = reads()
for i, j, k in product(range(31), range(31), range(3001)):
  water100 = A * i + B * j
  if C * k > water100 * E or water100 == 0:
    continue
  l = (water100 * E - C * k) // D
  sugar = C * k + D * l
  mass = water100 * 100 + sugar
  density = sugar / mass
  if mass <= F and maxd < density:
    maxd = density
    ans = (mass, sugar)

print(ans[0], ans[1])



### FIXED CODE ###

from sys import exit, setrecursionlimit, stderr
from functools import reduce
from itertools import *
from collections import *
from bisect import *
from heapq import *

def read():
  return int(input())
 
def reads():
  return [int(x) for x in input().split()]

maxd = -1
ans = None

A, B, C, D, E, F = reads()
for i, j, k in product(range(31), range(31), range(3001)):
  water100 = A * i + B * j
  if C * k > water100 * E or C * k > F - water100 * 100 or water100 == 0:
    continue
  l = min(water100 * E - C * k, F - water100 * 100 - C * k) // D
  sugar = C * k + D * l
  mass = water100 * 100 + sugar
  density = sugar / mass
  if mass <= F and maxd < density:
    maxd = density
    ans = (mass, sugar)

print(ans[0], ans[1])
def solve():
    A, B, C, D, E, F = map(int, input().split())
    memo = {}
    
    for a in range(31):
        for b in range(31):
            for c in range(101):
                for d in range(101):
                    w = (100*A)*a + (100*B)*b
                    s = C*c + D*d
                    if w ==0:
                        break
                    if w+s > F:
                        break
                    else:
                        if w/100 * E >= s:
                            dist = 100*s/(w+s)
                            memo[a,b,c,d] = dist
    
    max_v = max(memo.values())
    
    for k, v in memo.items():
        if v == max_v:
            print((100*A)*k[0] + (100*B)*k[1] + C*k[2] + D*k[3], C*k[2] + D*k[3] )
            break
 
if __name__ == '__main__':
	solve()

### FIXED CODE ###

a = input()
n = int(a) ** 2 

b = input()

print(n - int(b))
# n, k: 数値　s: 文字列　が与えられる
    # k文字目を入れ替えよ

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

    #dic = {"A":"a", "B":"b", "C":"c"}

    # キーとなる文字　文字列のインデックスは0から
    # s[k-1]


    # 小文字にする表現がある 下記なら1発
    print(s[:k-1] + s[k-1].lower() + s[k-1:])

    # [開始インデックス:終了インデックス] 数値は　より大　と　未満
    # print(s[:k-1] + dic.get(s[k-1]) + s[k-1:])

### FIXED CODE ###

n, k = map(int, input().split())
s = input()
print(s[:k-1] + s[k-1].lower() + s[k:])
N, T = input().split()
dic = {}
for i in range(N):
    c, t = [int(i) for i in input().split()]
    dic[t].append(c)
if max(dic) <= T:
    print(dic[max(dic)])
else:
    print('TLE')

### FIXED CODE ###

N, T = map(int, input().split())
costs = []
for i in range(N):
    c, t = map(int, input().split())
    if t <= T:
        costs.append(c)
if len(costs) == 0:
    print('TLE')
else:
    print(min(costs))
#!/usr/bin/env python3
import sys

YES = "YES"  # type: str
NO = "NO"  # type: str


def solve(N: int, K: int):
 	from math import ceil
    if(ceil(N/2) >= K):
        print(YES)
    else:
        print(NO)
    return


# Generated by 1.1.5.3 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    solve(N, K)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys

YES = "YES"  # type: str
NO = "NO"  # type: str


def solve(N: int, K: int):
    from math import ceil
    if(ceil(N/2) >= K):
        print(YES)
    else:
        print(NO)
    return


# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    solve(N, K)

if __name__ == '__main__':
    main()
def main():
    N = int(input())
    A = sorted(input().split(" "))
    ans = [0]*N
    for i in range(N):
        tmp = A[i]
        if (i == N-1):
            A[i] = A[N-2]
        else :
            A[i] = A[N-1]
        ans.append(recursive_gcd(N,A))
        A[i] = tmp
    print(max(ans))


def recursive_gcd(n,array):
    if (n <= 2):
        return gcd_euclid(int(array[0]),int(array[1]))
    else:
        return gcd_euclid(recursive_gcd(n-1,array),int(array[n-1]))

# http://d.hatena.ne.jp/sh-2/20100320/1269039543 から引用
def gcd_euclid(u, v) :
  while (0 != v) :
    r = u % v
    u = v
    v = r
  return u
#引用ここまで

if __name__ == "__main__":
    main()

### FIXED CODE ###

from fractions import gcd as m_gcd

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


def gcd(a, b):
    if a == 0 or b == 0:
        return max(a, b)
    return m_gcd(a, b)


l = [0] * (n + 2)
r = [0] * (n + 2)
ans = [0] * n

for i in range(1, n+1):
    l[i] = gcd(l[i - 1], a[i - 1])
    r[n - i + 1] = gcd(r[n - i + 2], a[n - i])

for i in range(1, n + 1):
    ans[i-1] = gcd(l[i-1], r[i+1])

print(max(ans))
import math

def main():
  n = int(input())
  a = list(map(int, input().split()))

  right = []
  left  = []

  right.append(a[0])
  left.append(a[-1])

  for i in range(1, len(a)-1):
    right.append(math.gcd(right[i-1], a[i]))
    left.append(math.gcd(left[i-1], a[-i-1]))
  
  ans = max(right[-1], left[-1])
  
  for i in range(len(right)-1):
    ans = max(ans, math.gcd(right[0], left[-2-i]))
    
  print(ans)
  
main()

### FIXED CODE ###

import fractions

def main():
  n = int(input())
  a = list(map(int, input().split()))

  right = []
  left  = []

  right.append(a[0])
  left.append(a[-1])

  for i in range(1, len(a)-1):
    right.append(fractions.gcd(right[i-1], a[i]))
    left.append(fractions.gcd(left[i-1], a[-i-1]))
  
  ans = max(right[-1], left[-1])
  
  for i in range(len(right)-1):
    ans = max(ans, fractions.gcd(right[i], left[-i-2]))
    
  print(ans)
  
main()
print(3*int(input()**2)

### FIXED CODE ###

print(3*int(input())**2)
n = input()
s = input()

if int(n) >= 3 and int(n) =< 50:
    print(s.count('ABC'))

### FIXED CODE ###

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

print(s.count('ABC'))
n = int(input().rstrip())
m = 0
for i in range(n):
  a, b = input().rstrip().split(' ')
  a = int(a)
  if b == 'BTC':
    a = 380000*a
  m += a
print(m)

### FIXED CODE ###

n = int(input().rstrip())
m = 0
for i in range(n):
  a, b = input().rstrip().split(' ')
  a = float(a)
  if b == 'BTC':
    a = 380000*a
  m += a
print(m)
s,w = map(int,input().split())

if s >= w :
  print(safe)
else:
  print(unsafe)

### FIXED CODE ###

s,w = map(int,input().split())

if s > w :
  print("safe")
else:
  print("unsafe")
for i in range(1, 10):
    for j in range(1, 10):
        print str(i) + "??" + str(j) + "=" + str(i * j)

### FIXED CODE ###

for i in range(1, 10):
    for j in range(1, 10):
        print str(i) + "x" + str(j) + "=" + str(i * j)
letter = input()
  
if letter.isUpper()==True:
  print('A')
else:
  print('a')
  

### FIXED CODE ###

letter = input()

if letter.isupper()==True:
  print('A')
else:
  print('a')
a,b,c=(map(int,input().split()))
gcd = 0
d = max[a,b]
for i in range(1,d+1):
  if a%i==0:
    if b%i==0:
      gcd+=1
      if gcd ==c:
        print(i)

### FIXED CODE ###

a,b,c=(map(int,input().split()))
gcd = 0
d = min(a,b)
for i in range(d,0,-1):
  if a%i==0 and b%i==0:
    gcd +=1
    if gcd ==c:
      print(i)
today = input()
 
if today = "Sunny":
  tomorrow = "Cloudy"
elif today = "Cloudy":
  tomorrow = "Rainy"
else:
  tomorrow = "Sunny"
 
print(tomorrow)

### FIXED CODE ###

today = input()
 
if today == "Sunny":
  tomorrow = "Cloudy"
elif today == "Cloudy":
  tomorrow = "Rainy"
else:
  tomorrow = "Sunny"
 
print(tomorrow)
input()
myarr = list(map(int, split(input())))
for i in range(1, len(myarr)):
    for j in range(i, 0,-1):
        if myarr[j] < myarr[j-1]:
            t = myarr[j]
            myarr[j] = myarr[j-1]
            myarr[j-1] = t
        else:
            break
    print(" ".join(map(str, myarr)))
        
    


### FIXED CODE ###

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

for i in range(len(arr)):
    for j in range(i,0,-1):
        if(arr[j] < arr[j-1]):
            temp = arr[j]
            arr[j] = arr[j-1]
            arr[j-1] = temp
        else:
            continue
    print(' '.join(map(str,arr)))
"""everything has a cost!"""

from math import *
import random
import functools
import collections
import sys

__author__ = 'p7x'



n, m = 0, 0


@functools.lru_cache(maxsize=None, typed=False)
def read(ti: int, tj: int, i: int, j: int) -> int:
    if (ti < n and (tj == m or a[ti] < b[tj])):
        return 1
    elif (tj < m and (ti == n or b[tj] < a[ti])):
        return 2
    elif (ti < n and tj < m):
        return read(ti+1, tj+1, i, j)
    else:
        if (ti == i):
            return 3
        else:
            return 1


if __name__ == '__main__':
    n, m, k = map(int, input().split())
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))

    mins = 0
    i, j = 0, 0
    while (mins < k):
        v = read(i, j, i, j)
        print(i, j, v)
        if (v == 1):
            mins += a[i]
            i += 1
        elif (v == 2):
            mins += b[j]
            j += 1
        else:
            break
    if mins > k:
        print(i+j-1)
    else:
        print(i+j)


### FIXED CODE ###

"""everything has a cost!"""

from math import *
import random, functools, collections, sys

__author__ = 'p7x'


# sys.stdin = open('in.txt', 'r')
# sys.stdout = open('out.txt', 'w')
# sys.stderr = open('err.txt', 'w')


if __name__ == '__main__':
    n,m,k = map(int, input().split())
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))

    for i in range(1,len(a)):
        a[i] += a[i-1]
    for i in range(1,len(b)):
        b[i] += b[i-1]

    j = len(b)-1
    while j > -1 and b[j] > k:
        j -= 1
    ans = j+1
    i = len(a)-1
    while i > -1 and a[i] > k:
        i -= 1
    ans = max(i+1,ans)

    for inx in range(i+1):
        while j > -1 and a[inx] + b[j] > k:
            j -= 1
        ans = max(inx+j+2,ans)
    print(ans)
import sys
from collections import Counter

def defs(c1, c2):
    
    if c1[0][1] > c2[0][1]:
        return c1[0], c2[1]
    else:
        return c1[1], c2[0]

def main():
    input = sys.stdin.readline
    
    n = int(input())
    m = [int(i) for i in input().split()]
    
    even = [m[i] for i, _ in enumerate(m) if i % 2 == 0]
    odd = [m[i] for i, _ in enumerate(m) if i % 2 == 1]
    
    even_c = Counter(even).most_common()
    odd_c = Counter(odd).most_common()
    
    if even_c[0] == odd_c[0]:
        print(len(m) / 2)
        return
    
#    print(even_c)
#    print(odd_c)
    
    even_c, odd_c = defs(even_c, odd_c)
    
    if even_c[1] == odd_c[1]:
        ans = len(odd) - min(even_c[1], odd_c[1])
        
    else:
        ans = len(m) - (even_c[1] + odd_c[1])
    
    print(ans)


if __name__ == '__main__':
    main()
    


### FIXED CODE ###

import sys
from collections import Counter
 
def main():
    input = sys.stdin.readline
    
    n = int(input())
    m = [int(i) for i in input().split()]
    
    #偶数列 奇数列
    even = [m[i] for i, _ in enumerate(m) if i % 2 == 0]
    odd = [m[i] for i, _ in enumerate(m) if i % 2 == 1]
    
    #頻値を取り出す
    even_c = Counter(even).most_common()
    odd_c = Counter(odd).most_common()
    
    ans = -1
    
    #print(even_c)
    #print(odd_c)
    #print(len(even_c))
    
    #最頻値の比較
    if even_c[0][0] != odd_c[0][0]:
        ans = len(m) - (even_c[0][1] + odd_c[0][1])
    
    #偶数列と奇数列の最頻値の数字が同じかつ、全て同じ数字じゃない
    elif even_c[0][0] == odd_c[0][0] and len(even_c) > 1:
        ans1 = len(m) - (even_c[0][1] + odd_c[1][1])
        ans2 = len(m) - (even_c[1][1] + odd_c[0][1])
        ans = ans1 if ans1 <= ans2 else ans2
    
    #全て同じ
    else:
        ans = even_c[0][1]
        
    #出力
    print(ans)
    
if __name__ == '__main__':
    main()
from statistics import *
while True:
    n = int(input())
    data = list(map(int,input().split()))  
    if(n == 0): break
    elif(n == 1):
        print("%.10f" %0)
    else:
        print(stdev(data))


### FIXED CODE ###

from math import *
while True:
    n = int(input())
    if(n == 0 ): break
    data = list(map(int,input().split()))  
    a = sum(data) / n
    b = 0
    c = 0
    for i in data:
        b += pow(i-a,2)
    c = sqrt(b/n)
    
    print(c)
s=input()
t=input()

count_min = 1000

for i in range(len(s)-len(t)+1):
  count = 0
  for j in range(len(t)):
    if s[i+j] != t[j]:
      count++
  if count < count_min:
    count_min = count

print(count_min)      

### FIXED CODE ###

s=input()
t=input()

count_min = 1000

for i in range(len(s)-len(t)+1):
  count = 0
  for j in range(len(t)):
    if s[i+j] != t[j]:
      count+=1 
  if count < count_min:
    count_min = count

print(count_min)
a,p=map(int,input().split())
if a>=13:
  print(b)
elif a>=6:
  print(b//2)
else:
  print("0")

### FIXED CODE ###

a,b=map(int,input().split())
if a>=13:
  print(b)
elif a>=6:
  print(b//2)
else:
  print("0")
def main():
    n,a,b=mi()
    s=input()
    nover=0
    tot=0
    for i in range(n):
        if tot<a+b:
            if s[i]=='a':
                print('Yes')
                tot+=1
            elif s[i]=='b' and nover<b:
                print('Yes')
                nover+=1
                tot+=1
            else:
                print('No')
        else:
            print('No')
main()

### FIXED CODE ###

n,a,b=map(int,input().split())
s=list(input())
nover=0
tot=0
for i in range(n):
    if tot<a+b:
        if s[i]=='a':
            print('Yes')
            tot+=1
        elif s[i]=='b' and nover<b:
            print('Yes')
            nover+=1
            tot+=1
        else:
            print('No')
    else:
        print('No')
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <math.h>
#include <iomanip>
#include <bitset>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <utility>
#include <set>
#include <map>
using namespace std;
//cout <<  << endl;
typedef long long int ll;
typedef long double ld;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const ll INF = 1LL << 60;
#define MOD 1000000007
#define MAX_V 100010
#define MAX_N 1000100
bool x[MAX_N];
ll num[MAX_N];
ll fibl[MAX_N]={0};
 
ll fib(ll a){
    if (fibl[a]!=0)return fibl[a];
    if (a==0){
        return 0;
    }else if (a==1){
        return 1;
    }
    return fibl[a]=fib(a-1)+fib(a-2);
}
 
ll eratosthenes(ll n) {
    int p = 0;
    for (ll i=0; i<=n; ++i) x[i] = true;
    x[0] = x[1] = false;
    for(int i=2; i<=n; ++i) {
        if(x[i]) {
            p++;
            for(int j=2*i; j<=n; j+=i) x[j] = false;
        }
        
        num[i] = p;
    }
    return p;
}
bool pairCompare(const pair<double,ll>& firstElof, const pair<double,ll>& secondElof){
    return firstElof.first < secondElof.first;
}
 
ll gcd(ll a,ll b){
    if (a%b==0)return(b);
    else return(gcd(b,a%b));
}
 
ll junnretu(ll n){
    ll ans=1;
    for (ll i=1;i<=n;i++){
        ans*=i;
    }
    return ans;
}
 
map<ll,ll> prime_factor(ll n){
    map<ll,ll> mp;
    for(ll i=2; i*i<=n; i++){
        while(n % i == 0){
            mp[i]++;
            n /= i;
        }
    }
    if(n != 1) mp[n] = 1;
    return mp;
}
 
ll keta(ll N){
    int tmp{};
    while( N > 0 ){
        tmp += ( N % 10 );
        N /= 10;
    }
    N = tmp;
    return N;
}

int main(){
    ll s;
    cin >> s;
    ll x[s];
    for (ll i=0;i<s;i++){
        cin >> x[i];
        for (ll j=0;j<=i;j++){
            if (x[i]==x[j]){
                cout << "NO" << endl;
                return 0;
            }
        }
    }
    cout << "YES" << endl;
    return 0;
}


### FIXED CODE ###

import collections
a=input()
a=int(a)
b=input().split()
c = collections.Counter(b)
        
if (len(c)==a):
  print("YES")
else:
  print("NO")
n = int(input())
A = [int(i) for i in input().split()]

C = []
max_A = max(A)
max_idx = A.index(max_A)
min_A = min(A)
min_idx = A.index(min_A)

if abs(max_A) >= abs(min_A):
    for i in range(n):
        A[i] += max_A
        C.append([max_idx+1, i+1])
    for i in range(1, n):
        A[i] += A[i-1]
        C.append([i, i+1])
else:
    for i in range(n):
        A[i] += min_A
        C.append([min_idx+1, i+1])
    for i in range(n-1):
        A[n-i+2] += A[n-i+1]
        C.append([n-i+2, n-i+3])

print(len(C))
for i, j in C:
    print('{0} {1}'.format(i, j))


### FIXED CODE ###

n = int(input())
A = [int(i) for i in input().split()]

C = []
max_A = max(A)
max_idx = A.index(max_A)
min_A = min(A)
min_idx = A.index(min_A)

if abs(max_A) >= abs(min_A):
    for i in range(n):
        #A[i] += max_A
        C.append([max_idx+1, i+1])
    for i in range(1, n):
        #A[i] += A[i-1]
        C.append([i, i+1])
else:
    for i in range(n):
        #A[i] += min_A
        C.append([min_idx+1, i+1])
    for i in range(n, 1, -1):
        #A[n-i+2] += A[n-i+1]
        #C.append([n-i+2, n-i+3])
        C.append([i, i-1])

print(len(C))
for i, j in C:
    print('{0} {1}'.format(i, j))
from math import gcd

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

mod = int(1e9 + 7)

while True:
    try:
        n = int(input())
        a = list(map(int, input().split()))
    except:
        break

    l = a[0]
    for i in range(1, n):
        l = lcm(l, a[i])

    ans = 0
    for i in range(n):
        ans = (ans + l // a[i]) % mod
    print(ans)

### FIXED CODE ###

mod = int(1e9 + 7)

def inv(x):
    return pow(x, mod - 2, mod)

def gcd(a, b):
    return a if b == 0 else gcd(b, a % b)

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

def mod_lcm(a, b):
    return a * b % mod * inv(gcd(a, b)) % mod


while True:
    try:
        n = int(input())
        a = list(map(int, input().split()))
    except:
        break

    l = a[0]
    for i in range(1, n):
        l = lcm(l, a[i])
    l %= mod

    ans = 0
    for i in range(n):
        ans = (ans + l * inv(a[i])) % mod
    print(ans)
import sys
#stdin = sys.stdin

sys.setrecursionlimit(10 ** 7)

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x) - 1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

n = ni()
a = list(li())

odd = 0
ml2 = 0
ml4 = 0

for ai in a:
    if ai % 2:
        odd += 1
    elif ai % 4:
        ml2 = 1
    else:
        ml4 += 1

print("Yes" if (odd + ml2) <= (ml4 + 1) else "No")

### FIXED CODE ###

import sys
stdin = sys.stdin

sys.setrecursionlimit(10 ** 7)

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x) - 1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

n = ni()
a = list(li())

odd = 0
ml2 = 0
ml4 = 0

for ai in a:
    if ai % 2:
        odd += 1
    elif ai % 4:
        ml2 = 1
    else:
        ml4 += 1

print("Yes" if (odd + ml2) <= (ml4 + 1) else "No")
from itertools import accumulate
from collections import Counter
N = int(input())
L = sorted(list(map(int, input().split())))


acc = [0] * 1001
for l in L:
    acc[l] += 1
acc = list(accumulate(acc))


ans = 0
for i in range(N):
    for j in range(i + 1, N):
        l1, l2 = L[i], L[j]
        if l1 == l2:
            continue
        ans += acc[min(1000, l1 + l2 - 1)] - acc[l2]

C = Counter(L)
for k, v in C.items():
    if v >= 3:
        ans += v * (v - 1) * (v - 2) // 6

for k, v in C.items():
    if v >= 2:
        ans += v * (v - 1) // 2 * (acc[min(1000, 2 * v - 1)] - acc[v])

print(ans)


### FIXED CODE ###

from bisect import bisect_right
N = int(input())
L = sorted(list(map(int, input().split())))
L = [(l, i) for i, l in enumerate(L)]

ans = 0
for i in range(N):
    for j in range(i + 1, N):
        l1_value, l1_index = L[i]
        l2_value, l2_index = L[j]
        ans += max(0, (bisect_right(L, (l1_value + l2_value, l2_index))) - j - 1)

print(ans)
# Nマス H[N-1]まである
N = int(input())
tmp = input()
H = [int(x.strip()) for x in tmp.split(' ')]
n = 0
lists = list()
lists.append(0)
count = 0
while True:
    if H[n] >= H[n+1]:
        while H[n] >= H[n+1]:
            count += 1
            n += 1
            if n == N-1:
                lists.append(count)
                break
        lists.append(count)
        count = 0
        if n == N-1:
            break
    else:
        n += 1
        if n == N-1:
            break
print(max(lists))
print(lists)

### FIXED CODE ###

N = int(input())
tmp = input()
H = [int(x.strip()) for x in tmp.split(' ')]
n = 0
lists = list()
lists.append(0)
count = 0
while n <= N-2:
    if H[n] >= H[n+1]:
        while H[n] >= H[n+1]:
            count += 1
            n += 1
            if n == N-1:
                lists.append(count)
                break
        lists.append(count)
        count = 0
    else:
        n += 1
print(max(lists))
n, m = [int(i) for i in input().split(' ')]
c_list = []
for i in range(m):
    c_list.append([int(i) for i in input().split(' ')])
number = [-1 for i in range(n)]
for line in c_list:
    if number[line[0] - 1] == -1:
        number[line[0] - 1] = line[1]
    else:
        if number[line[0] - 1] == line[1]:
            continue
        else:
            print("-1")
            break
else:
    if number[0] == 0 and len(number) != 1:
        print("-1")
    else:
        for i, index in enumerator(number):
            if index == -1:
                if i == 0:
                    index = 1
                else:
                    index = 0
            print(index, end="")

### FIXED CODE ###

n, m = [int(i) for i in input().split(' ')]
c_list = []
for i in range(m):
    c_list.append([int(i) for i in input().split(' ')])
number = [-1 for i in range(n)]
for line in c_list:
    if number[line[0] - 1] == -1:
        number[line[0] - 1] = line[1]
    else:
        if number[line[0] - 1] == line[1]:
            continue
        else:
            print("-1")
            break
else:
    if number[0] == 0:
        if len(number) != 1:
            print("-1")
        else:
            print("0")
    else:
        for i, index in enumerate(number):
            if index == -1:
                if i == 0 and len(number) != 1:
                    index = 1
                else:
                    index = 0
            print(index, end="")