Harryxun/stf_run huggingface dataset:
n,a,b=input().split()

tmp1,tmp2=divmod(N,a+b)

blue=tmp1*a
if(tmp2>a):
  blue=blue+a
eles:
  blue=blue+tmp2
  
print("blue")

### FIXED CODE ###

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

tmp1,tmp2=divmod(n,a+b)

blue=tmp1*a
if(tmp2>a):
  blue=blue+a
else:
  blue=blue+tmp2
  
print(blue)
k=int(input())
s=input()
if s<=k:
    print(s)
else:
    print(s[:k]+"...")

### FIXED CODE ###

k=int(input())
s=input()
if len(s)<=k:
    print(s)
else:
    print(s[:k]+"...")
import sys
n, k = map(int, input().split())
a = list(map(int, input().split()))


if a[-1] < k:
    print('IMPOSSIBLE')
    sys.exit(0)

seta = set(a)
if k in seta:
    print('POSSIBLE')
    sys.exit(0)
change = True
while change:
    change = False
    setb = seta.copy()
    sorteda = sorted(seta)
    for i in range(1, len(sorteda)):
        setb.add(sorteda[i] % sorteda[0])
    if setb != seta:
        change = True
        seta = setb

mini = sorted(seta)[1]
a.sort()
a.reverse()

for i in a:
    if (k - i) % mini == 0:
        print('POSSIBLE')
        sys.exit(0)
print('IMPOSSIBLE')

### FIXED CODE ###

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


a.sort()
if a[-1] < k:
    print('IMPOSSIBLE')
    sys.exit(0)

seta = set(a)
if k in seta:
    print('POSSIBLE')
    sys.exit(0)
change = True
while change:
    change = False
    setb = seta.copy()
    sorteda = sorted(seta)
    mini = sorteda[0] if sorteda[0] != 0 else sorteda[1]
    for i in range(1, len(sorteda)):
        setb.add(sorteda[i] % mini)
    if setb != seta:
        change = True
        seta = setb

mini = sorted(seta)[1]
a.reverse()

for i in a:
    if (k - i) % mini == 0:
        print('POSSIBLE')
        sys.exit(0)
print('IMPOSSIBLE')
n, m = map(int, input().split())
a = list(i for i in input().suplt)

all_homework_day = sum(a)

if all_homework_day <= n:
    play_day = all_homework_day
else:
    play_day = -1

print(play_day)

### FIXED CODE ###

n, m = map(int, input().split())
a = list(int(i) for i in input().split())

all_homework_day = sum(a)

if all_homework_day <= n:
    play_day = n - all_homework_day
else:
    play_day = -1

print(play_day)
"""Knapsack"""
import sys

sys.setrecursionlimit(10 ** 9)
input = sys.stdin.readline
s = input().rstrip()
gx, gy = map(int, input().split())
rx, ry = 0, 0
head, inst = 0, []
while head < len(s) and s[head] == "F":
    head += 1
    rx += 1

xlist, ylist = [], []
heading_x = True
while head < len(s):
    tcnt = 0
    while head < len(s) and s[head] == "T":
        tcnt += 1
        head += 1
    if head == len(s):
        break
    fcnt = 0
    while head < len(s) and s[head] == "F":
        fcnt += 1
        head += 1
    if ((tcnt % 2) == 1) ^ heading_x:
        heading_x = True
        xlist.append(fcnt)
    else:
        heading_x = False
        ylist.append(fcnt)


def fill(fs, goal_offset):
    f_total = sum(fs)
    if f_total < goal_offset:
        return False
    if f_total == goal_offset:
        return True
    f_diff = f_total - goal_offset
    diffs = {0}
    for f in fs:
        for d in list(diffs):
            d2 = f + d
            if d2 > f_diff:
                continue
            if d2 == f_diff:
                return True
            diffs.append(d2)
    return False


if fill(xlist, abs(gx - rx)) and fill(ylist, abs(gy - ry)):
    print("Yes")
else:
    print("No")


### FIXED CODE ###

"""Knapsack"""
import sys

sys.setrecursionlimit(10 ** 9)
input = sys.stdin.readline
s = input().rstrip()
gx, gy = map(int, input().split())
rx, ry = 0, 0
head, inst = 0, []
while head < len(s) and s[head] == "F":
    head += 1
    rx += 1

xlist, ylist = [], []
heading_x = True
while head < len(s):
    tcnt = 0
    while head < len(s) and s[head] == "T":
        tcnt += 1
        head += 1
    if head == len(s):
        break
    fcnt = 0
    while head < len(s) and s[head] == "F":
        fcnt += 1
        head += 1
    if ((tcnt % 2) == 1) ^ heading_x:
        heading_x = True
        xlist.append(fcnt)
    else:
        heading_x = False
        ylist.append(fcnt)


def fill(fs, goal_offset):
    f_total = sum(fs)
    if f_total < goal_offset:
        return False
    if f_total == goal_offset:
        return True
    f_diff = f_total - goal_offset
    if f_diff % 2 == 1:
        return False
    f_diff //= 2
    diffs = {0}
    for f in fs:
        for d in list(diffs):
            d2 = f + d
            if d2 > f_diff:
                continue
            if d2 == f_diff:
                return True
            diffs.add(d2)
    return False


if fill(xlist, abs(gx - rx)) and fill(ylist, abs(gy - ry)):
    print("Yes")
else:
    print("No")
O = list(input())
E = list(input())
password = []
if len(O) - len(E) == 0:
    for i in range(len(O)):
        password.append(O[i])
        password.append(E[i])
elif len(O) - len(E) == 1:
    for i in range(len(E)):
        password.append(O[i])
        password.append(E[i])
    password.append(O[len(O)])
password = "".join(password)

print(password)

### FIXED CODE ###

O = list(input())
E = list(input())
password = []
if len(O) - len(E) == 0:
    for i in range(len(O)):
        password.append(O[i])
        password.append(E[i])
elif len(O) - len(E) == 1:
    for i in range(len(E)):
        password.append(O[i])
        password.append(E[i])
    password.append(O[len(O)-1])
password = "".join(password)

print(password)
n = int(input())
c,s,f = [0]*(n-1)
for i in range(n-1): c[i],s[i],f[i] = map(int,input().split())
for j in range(n-1):
	answer = 0
	for k in range(j,n-1):
		if answer<s[k]: answer = s[k]
		elif answer%f[k]: answer += f[k]-(answer%f[k])
		answer += c[k]
	print(answer)

### FIXED CODE ###

n = int(input())
c,s,f = [0]*(n-1),[0]*(n-1),[0]*(n-1)
for i in range(n-1): c[i],s[i],f[i] = (int(i2) for i2 in input().split())
for j in range(n):
	answer = 0
	for k in range(j,n-1):
		if answer<s[k]: answer = s[k]
		elif answer%f[k]: answer += f[k]-(answer%f[k])
		answer += c[k]
	print(answer)
N=int(input())
li = input().split()	

tmp='0'
cnt=0

for i in range(N):
	if li[i]!=tmp:
    	cnt+=1
        tmp=li[i]
print(cnt)
    	
    
  
 
    
    


### FIXED CODE ###


N=int(input())
li=list(input())

tmp='0'
cnt=0
 
for i in range(N):
    if li[i]!=tmp:
        cnt+=1
        tmp=li[i]
print(cnt)
s = input()

if s = 'AAA' or 'BBB':
    print('No')
else:
    print('Yes')

### FIXED CODE ###

s = input()

if s == 'AAA' or s == 'BBB':
    print('No')
else:
    print('Yes')
# -*- coding: utf-8 -*-

n,k,s = list(map(int,input().split()))
a = []
count = 0
st = ""

for i in range(k):
    a.append(s)

for i in range(n-k):
    a.append(s-1)

if s-1 == 0:
    a = []
    a.append(1)

for i in range(n):
    if st == "":
        st = str(a[count])
    else:
        st += " " + str(a[count])
    count += 1

print(st)

### FIXED CODE ###

# -*- coding: utf-8 -*-

n,k,s = list(map(int,input().split()))
a = []
count = 0
st = ""

for i in range(k):
    a.append(s)

for i in range(n-k):
    if s < 2:
        a.append(s+1)
    else:
        a.append(s-1)
    
for i in range(n):
    if st == "":
        st = str(a[count])
    else:
        st += " " + str(a[count])
    count += 1

print(st)
import os
import sys

import numpy as np


def solve(x, t):
    visit = [0] * n
    visit[x] = 1
    loop = [0] * n
    count = 0
    ans = c[p[x] - 1]
    l = True
    sub = 0
    while True:
        x = p[x] - 1
        if l:
            if visit[x]:
                if loop[x]:
                    ln = sum(loop)
                    if t > l:
                        sub += (t // ln - 1) * count * (count > 0)
                        t %= ln
                        t += ln
                    l = False
                count += c[x]
                loop[x] = 1
            visit[x] = 1
        sub += c[x]
        t -= 1
        ans = max(sub, ans)
        if t < 1:
            return ans


# >>> numba compile >>>
numba_config = [
    [solve, "i8(i8,i8)"],
]
if sys.argv[-1] == "ONLINE_JUDGE":
    from numba import njit
    from numba.pycc import CC

    cc = CC("my_module")
    for func, signature in numba_config:
        vars()[func.__name__] = njit(signature)(func)
        cc.export(func.__name__, signature)(func)
    cc.compile()
    exit()
elif os.name == "posix":
    exec(
        f"from my_module import {','.join(func.__name__ for func, _ in numba_config)}"
    )
else:
    from numba import njit

    for func, signature in numba_config:
        vars()[func.__name__] = njit(signature, cache=True)(func)
    print("compiled!", file=sys.stderr)
# <<< numba compile <<<
(n, k), p, c = [np.int_(i.split()) for i in open(0)]
print(max(solve(i, k) for i in range(n)))


### FIXED CODE ###

(n, k), p, c = [[*map(int, i.split())] for i in open(0)]

def solve(x, t):
    visit = [0] * n
    visit[x] = 1
    loop = [0] * n
    count = 0
    ans = c[p[x] - 1]
    l = True
    sub = 0
    while True:
        x = p[x] - 1
        if l:
            if visit[x]:
                if loop[x]:
                    ln = sum(loop)
                    if t > l:
                        sub += (t//ln -1)*count*(count>0)
                        t %= ln
                        t += ln
                    l = False
                count += c[x]
                loop[x] = 1
            visit[x] = 1
        sub += c[x]
        t -= 1
        ans = max(sub, ans)
        if t < 1:
            return ans


print(max(solve(i, k) for i in range(n)))
x, y, z, k = map(int, input().split())
c_s = list(map(int, input().split()))
b_s = list(map(int, input().split()))
a_s = list(map(int, input().split()))
a_s.sort(reverse=True)
b_s.sort(reverse=True)
c_s.sort(reverse=True)

d = {}
abcs = [0]
j = -1

for a in a_s:
    for b in b_s:
        for c in c_s:
            abc = a + b + c
            if j >= k and abcs[k-1] >= abc:
                break
            if abcs[0] == 0:
                abcs[0] = abc
            else:
                for i in reversed(range(len(abcs))):
                    if abcs[i] >= abc:
                        abcs.insert(i+1, abc)
                        break
                abcs = abcs[:k-1]
            j += 1
for i in range(k):
    print(abcs[i])


### FIXED CODE ###

x, y, z, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))

ab = []
for ai in a:
  for bi in b:
    ab.append(ai + bi)
ab.sort(reverse = True)

abc = []

for abi in ab[:k]:
  for ci in c:
    abc.append(abi + ci)
abc.sort(reverse = True)

for abci in abc[:k]:
  print(abci)
import fractions


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

    gcd_l = [0]
    gcd_r = [0]
    for i in range(N):
        gcd_l.append(fractions.gcd(gcd_l[i], A[i]))
        gcd_r.append(fractions.gcd(gcd_r[i], A[-(i+1)]))
    gcd_r = gcd_r[::-1]

    ans = []
    for i in range(N):
        ans.append(fractions.gcd(gcd_l[i], gcd_r[i+1]))

	print(max(ans))

### FIXED CODE ###

import fractions


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

  gcdl = [0]
  gcdr = [0]
  for i in range(N):
      gcdl.append(fractions.gcd(gcdl[i], A[i]))
      gcdr.append(fractions.gcd(gcdr[i], A[-(i+1)]))
  gcdr = gcdr[::-1]

  ans = []
  for i in range(N):
      ans.append(fractions.gcd(gcdl[i], gcdr[i+1]))
  print(max(ans))
import numpy as np
N, K = map(int, input().split())
d = []
for _ in range(N):
    a, b= map(int, input().split())
    c = [a] * b
    d.append(c)
print(sorted(c)[K-1])

### FIXED CODE ###

N, K = map(int, input().split())
num = [0]*(10**5+1)
for i in range(N):
    a, b= map(int, input().split())
    num[a] += b
for i in range(1, 10**5+1):
    if K <= num[i]:
        print(i)
        exit()
    K -= num[i]
import sys
from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall

input = sys.stdin.readline

def main():
    n, m, l = map(int, input().split())
    wf = [[(300 * (10**9) + 1) for i in range(n)] for j in range(n)]
    for i in range(m):
        a, b, c = map(int, input().split())
        wf[a-1][b-1] = c
        wf[b-1][a-1] = c
    G = csgraph_from_dense(wf)
    d = floyd_warshall(G)
    for i in range(n):
        for j in range(n):
            if d[i][j] <= l:
                wf[i][j] = 1
            else:
                wf[i][j] = 301
    G = csgraph_from_dense(wf)
    d = floyd_warshall(G)
    q = int(input())
    ans = [None] * q
    for i in range(q):
        s, t = map(int, input().split())
        if d[s-1][t-1] < 301:
            ans[i] = int(d[s-1][t-1])
        else:
            ans[i] = 0
    for i in range(q):
        print(ans[i] - 1)

if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
import numpy as np
from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall, shortest_path

input = sys.stdin.readline

def main():
    n, m, l = map(int, input().split())
    wf = [[0 for i in range(n)] for j in range(n)]
    for _ in range(m):
        a, b, c = map(int, input().split())
        wf[a-1][b-1] = wf[b-1][a-1] = c
    wf = np.array(wf)
    for i in range(n):
        wf[i][i] = 0
    wf = shortest_path(wf, method='FW')
    for i in range(n):
        for j in range(n):
            if wf[i][j] <= l:
                wf[i][j] = 1
            else:
                wf[i][j] = 301
    wf = shortest_path(wf, method='FW')
    q = int(input())
    ans = [None] * q
    for i in range(q):
        s, t = map(int, input().split())
        if wf[s-1][t-1] < 301:
            ans[i] = int(wf[s-1][t-1])
        else:
            ans[i] = 0
    for i in range(q):
        print(ans[i] - 1)

if __name__ == "__main__":
    main()
def sum(n):
  n=str(n)
  return sum(list(map(int,n)))

t=0
n,a,b=map(int, input().split())
for i in range(0,n+1):
  print(i)
  if a<=sum(i)<=b:t+=i
print(t)

### FIXED CODE ###

def SUM(N):
  N=str(N)
  return sum(list(map(int,N)))

t=0
n,a,b=map(int, input().split())
for i in range(n+1):
  if a<=SUM(i)<=b:t+=i
print(t)
INF = float('inf')
MAX_N = 110
MAX_W = 10**5 + 1000

N, W = map(int, input().split())
w, v = [0]*N, [0]*N
for i in range(N):
    w[i], v[i] = map(int, input().split())

dp = [[0]*MAX_N for _ in range(MAX_W)]

for i in range(1,N+1):
    for j in range(W+1):
        if j-w[i-1]>=0:
            dp[i][j] = max(dp[i][j], dp[i-1][j-w[i-1]]+v[i-1])
        dp[i][j] = max(dp[i][j], dp[i-1][j])
print(dp[N][W])

### FIXED CODE ###

INF = float('inf')
MAX_N = 110
MAX_W = 10**5 + 100

N, W = map(int, input().split())
w, v = [0]*N, [0]*N
for i in range(N):
    w[i], v[i] = map(int, input().split())

dp = [[0]*MAX_W for _ in range(MAX_N)]

for i in range(1,N+1):
    for j in range(W+1):
        if j-w[i-1]>=0:
            dp[i][j] = max(dp[i][j], dp[i-1][j-w[i-1]]+v[i-1])

        dp[i][j] = max(dp[i][j], dp[i-1][j])

print(dp[N][W])
x=int(input())
cnt = 0
q = x // 500
cnt += (q * 1000)
w = x % 500
e = w // 5
cnt += (e * 5)
print(cnt)

### FIXED CODE ###

a=list(input())
if a[2] == a[3] and a[4] == a[5]:
  print('Yes')
else:
  print('No')
N, K = map(int, input().split())
S = str(input())
S_list = []
cum_list = [0]
tmp = 1
count = 0

for i in range(N):
    if i == 0:
        if int(S[i]) == tmp:
             count += 1
        else:
            S_list.append(count)
            count = 1
    else:
        if S[i] == S[i - 1]:
            count += 1
            
        else:
            S_list.append(count)
            count = 1

S_list.append(count)
if S[-1] == "0":
    S_list.append(0)


now = 0
for i in range(len(S_list)):
    now += S_list[i]
    cum_list.append(now)


answer_list = []
i = 0
if 2 * K + 1 < len(cum_list):
    while i + 2 * K + 1 < len(cum_list):
        answer_list.append(cum_list[i + 2 * K + 1] - cum_list[i])
        i += 2
else:
    answer_list.append(len(S))
answer_list = check(cum_list,K)
answer = max(answer_list)
print(answer)

### FIXED CODE ###

N, K = map(int, input().split())
S = str(input())
S_list = []
cum_list = [0]
tmp = 1
count = 0

for i in range(N):
    if i == 0:
        if int(S[i]) == tmp:
             count += 1
        else:
            S_list.append(count)
            count = 1
    else:
        if S[i] == S[i - 1]:
            count += 1
            
        else:
            S_list.append(count)
            count = 1

S_list.append(count)
if S[-1] == "0":
    S_list.append(0)


now = 0
for i in range(len(S_list)):
    now += S_list[i]
    cum_list.append(now)


answer_list = []
i = 0
if 2 * K + 1 < len(cum_list):
    while i + 2 * K + 1 < len(cum_list):
        answer_list.append(cum_list[i + 2 * K + 1] - cum_list[i])
        i += 2
else:
    answer_list.append(len(S))
answer = max(answer_list)
print(answer)
import sys
import os


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = int(sys.stdin.readline().rstrip())

    ret = float('inf')
    for i in range(1, 10000000):
        q, mod = divmod(N, i)
        if mod == 0:
            j = N // i
            ret = min(ret, ((j-1)+(i-1)))

    print(ret)


if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
import os


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    a, b = list(map(int, sys.stdin.readline().split()))
    if a < 10 and b < 10:
        print(a*b)
    else:
        print(-1)


if __name__ == '__main__':
    main()
import sys
input=sys.stdin.readline
N,M = map(int,input().split())
nCr = {}
def cmb(n, r):
    if r == 0 or r == n:
         return 1
    if r == 1:
         return n
    if (n,r) in nCr:
         return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]

a = cmb(N,2)
b = cmb(M,2)
print(a+b)

### FIXED CODE ###

import sys
input=sys.stdin.readline
N,M = map(int,input().split())
nCr = {}
def cmb(n, r):
    if n == 0:
        return 0
    if r == 0 or r == n:
         return 1
    if r == 1:
         return n
    if (n,r) in nCr:
         return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]

a = cmb(N,2)
b = cmb(M,2)
print(a+b)
import math

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

if x >= a*a*b/2:
    tan_theta = a**2 / (2*(a*b - x/a))
    theta = math.atan(tan_theta)
    print(90 - math.degrees(theta))
else:
    tan_theta = 2*x / (a*(b**2))
    theta = math.atan(tan_theta)
    print(90 - math.degrees(theta))


### FIXED CODE ###

import math

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

if a*a*b == x:
    print(0)
    exit()

if x >= a*a*b/2:
    tan_theta = a**2 / (2*(a*b - x/a))
    theta = math.atan(tan_theta)
    print(90 - math.degrees(theta))
else:
    tan_theta = 2*x / (a*(b**2))
    theta = math.atan(tan_theta)
    print(90 - math.degrees(theta))
A, B, C = [int(i) for i in input().split()]

A, B, C = B, A, C
A, B, C = C, B, A

print(f"{A} {B} {C}")


### FIXED CODE ###

A, B, C = [int(i) for i in input().split()]

A, B, C = B, A, C
A, B, C = C, B, A

print("%s %s %s" % (A, B, C))
s = input()

if s[-1] = "s":
  print(s + "es")
else:
  print(s + "s")

### FIXED CODE ###

s = input()
 
if s[-1] == "s":
  print(s + "es")
else:
  print(s + "s")
N = int(input())
s = []
for _ in range(N):
    s.append(input())
    
M = int(input())
t = []
for _ in range(M):
    t.append(input())


mine = 0
    
flags = [1] * N

for i in range(N):
    plus = 1
    minus = 0
    
    if flags[i] == 0:
        continue
        
    if flags[i] == 1:
        flags[i] = 0
    
    for j in range(i+1, N):
        if s[i] == s[j]:
            plus += 1
            flags[j] = 0
            
    for k in range(M):
        if s[i] == t[k]:
            minus += 1
            
    mine = max[mine, plus - minus]       

    
print(mine)

### FIXED CODE ###

N = int(input())
s = []
for _ in range(N):
    s.append(input())
    
M = int(input())
t = []
for _ in range(M):
    t.append(input())


mine = 0
    
flags = [1] * N

for i in range(N):
    plus = 1
    minus = 0
    
    if flags[i] == 0:
        continue
        
    if flags[i] == 1:
        flags[i] = 0
    
    for j in range(i+1, N):
        if s[i] == s[j]:
            plus += 1
            flags[j] = 0
            
    for k in range(M):
        if s[i] == t[k]:
            minus += 1
            
    mine = max([mine, plus - minus]) 

    
print(mine)
import math
N = int(input())
ps = []
minx = float('inf')
miny = float('inf')
mini = None
for i in range(N):
  x, y = map(int, input().split())
  if x <= minx and y < miny:
    minx = x
    miny = y
    mini = i
  ps.append((x, y))

if len(ps) == 2:
  print(0.5)
  print(0.5)
  exit()

# 2点の2等分線の単位ベクトルを返す
# i -> j に対して右方向
def divvector(xi, yi, xj, yj):
  if xi == xj:
    if yj > yi: return (1, 0)
    else: return (-1, 0)
  elif yi == yj:
    if xj > xi: return (0, -1)
    else: return (0, 1)

  a = (yi - yj) / (xi - xj) # 傾き
  b = (1/a**2)
  x = math.sqrt(1/(1+b))
  y = math.sqrt(b/(1+b))
  if xj > xi:
    if yj > yi: return (x, -y)
    else: return (-x, -y)
  else:
    if yj > yi: return (x, y)
    else: return (-x, y)

# p1 -> p0 -> p2 が時計回りかどうか
def clockwise(x0, y0, x1, y1, x2, y2):
  return (x1 - x0) * (y2 - y0) - (x2 - x0) * (y1 - y0) <= 0

# 反時計回りに、凸包を求める
first = now = mini
convexs = [now]
divvecs = { now: [] }
end = False
while not end:
  for j in range(N):
    if j == now or j != first and j in divvecs: continue
    for k in range(N):
      if k == now or k == j: continue
      if not clockwise(ps[j][0], ps[j][1], ps[now][0], ps[now][1], ps[k][0], ps[k][1]):
        break
    else:
      convexs.append(j)
      divv = divvector(ps[now][0], ps[now][1], ps[j][0], ps[j][1])
      divvecs[now].append(divv)
      if j not in divvecs:
        divvecs[j] = []
      divvecs[j].append(divv)
      now = j
      if now == first:
        end = True
      break

# 凸包を構成する各頂点について、
# 隣の頂点との二等分線のなす角を360度で割ったものが確率
# 凸包を構成しない点については、確率はほぼ0
for i in range(N):
  if i not in convexs:
    print(0)
    continue
  v1, v2 = divvecs[i]
  # すでに単位ベクトルになっているので、cos = 内積
  cos = v1[0]*v2[0] + v1[1]*v2[1]
  print(math.acos(cos) / (2*math.pi))

### FIXED CODE ###

import math
N = int(input())
ps = []
for i in range(N):
  x, y = map(int, input().split())
  ps.append((x, y, i))
ps.sort()

# i -> j のベクトル
def vec(pi, pj):
  return (pj[0] - pi[0], pj[1] - pi[1])
# i -> j 向きの外積
def det(vi, vj):
  return vi[0] * vj[1] - vi[1] * vj[0]

# 凸包を求める
cvx = []
for i in list(range(N)) + list(range(N-1))[::-1]:
  while len(cvx) >= 2 and det(vec(ps[cvx[-2]], ps[cvx[-1]]), vec(ps[cvx[-1]], ps
[i])) < 0:
    cvx.pop()
  cvx.append(i)

# 凸包の各頂点について、頂点から出る2辺のなす角を計算
ans = {}
pi = None
for i in cvx:
  x, y, j = ps[i]
  if pi is not None:
    px, py, pj = ps[pi]
    slope = math.atan2(y-py, x-px)
    if j not in ans: ans[j] = [0, 0]
    if pj not in ans: ans[pj] = [0, 0]
    ans[j][0] = slope
    ans[pj][1] = slope
  pi = i

for i in range(N):
  if i not in ans:
    print(0)
    continue
  v1, v2 = ans[i]
  if v2 < v1:
    v2 += 2*math.pi
  print(round((v2-v1) / (2*math.pi), 8))
N,M = input().split()
s,c,a = [],[],[]
number = []
for i in range(int(M)):
    a_i = input().split()
    a.append(a_i)
    s.append(int(a_i[0]))
    c.append(int(a_i[1]))
ans = True
for i in range(int(M)):
    number.append('')
for i in range(int(M)):
    if s[i]==1 and c[i]==0:
        print('-1')
        ans = False
    elif number[s[i]-1] == '' or number[s[i]-1] == c[i]:
        number[s[i]-1] = c[i]
    else:
        print('-1')
        ans = False
for i,elem in enumerate(number):
    if elem == '' and i == 0:
        number[i] = 1
    if elem == '':
        number[i] = 0
if ans:
    strs = '' 
    for i in number:
        strs += str(i)
    print(int(strs))

### FIXED CODE ###

N,M = input().split()
s,c,a = [],[],[]
number = []
for i in range(int(M)):
    a_i = input().split()
    a.append(a_i)
    s.append(int(a_i[0]))
    c.append(int(a_i[1]))
ans = True
for i in range(int(N)):
    number.append('')
for i in range(int(M)):
    if s[i]==1 and c[i]==0 and int(N)>1:
        if ans:
            print('-1')
            ans = False
    elif s[i] > int(N):
        if ans:
            print('-1')
            ans = False
    elif number[s[i]-1] == '' or number[s[i]-1] == c[i]:
        number[s[i]-1] = c[i]
    else:
        if ans:
            print('-1')
            ans = False
for i,elem in enumerate(number):
    if number[i] == '' and i == 0 and int(N) >1:
        number[i] = 1
    elif elem == '':
        number[i] = 0
if ans:
    strs = '' 
    for i in number:
        strs += str(i)
    print(int(strs))