Problem:


Score : 100 points

Problem Statement

You will be given an integer a and a string s consisting of lowercase English letters as input.

Write a program that prints s if a is not less than 3200 and prints red if a is less than 3200.

Constraints

2800 \leq a < 5000

s is a string of length between 1 and 10 (inclusive).

Each character of s is a lowercase English letter.

Input

Input is given from Standard Input in the following format:

a
s

Output

If a is not less than 3200, print s; if a is less than 3200, print red.

Sample Input 1

3200
pink

Sample Output 1

pink

a = 3200 is not less than 3200, so we print s = pink.

Sample Input 2

3199
pink

Sample Output 2

red

a = 3199 is less than 3200, so we print red.

Sample Input 3

4049
red

Sample Output 3

red

a = 4049 is not less than 3200, so we print s = red.



Sample input:
3200
pink


Sample output:
pink

Submission status: Runtime Error

Solution code:
def dfs(u, cnt):
    cnt += point[u]
    counter[u] = cnt
    color[u] = GRAY
    for v in M[u]:
        if color[v] == WHITE:
            dfs(v, cnt)
    color[u] = BLACK

import sys
sys.setrecursionlimit(100000)

n, q = map(int, input().split())
M = [[] for _ in range(n)]
point = [0] * n
for i in range(n-1):
    a, b = map(int, input().split())
    M[a-1].append(b-1)
    M[b-1].append(a-1)
for i in range(q):
    p, x = map(int, input().split())
    point[p-1] += x
#print(M, point)
    
WHITE, GRAY, BLACK = 0, 1, 2
color = [WHITE] * n

counter = [0] * n
dfs(0, 0)

print(*counter)

Submission status: Runtime Error

Solution code:
a = int(input())
s = input()
if a >= 3200:
	pint(s)
else:
	print('red')

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(10**6)

n, q = map(int, input().split())
g=[[] for _ in range(n)]

for i in range(n-1): # 行列の作成
    a, b = map(int, input().split())
    g[a - 1].append(b - 1)
    g[b - 1].append(a - 1)

costs = [0]*n # 答えの格納

for i in range(q): # コスト初期値の入力
    p, x = map(int, input().split())
    costs[p-1]+=x

visited = [0]*n # 訪問スタンプ

def dfs(idx):
    visited[idx]=1
    for i in g[idx]:
        if visited[i]==1:
            continue
        costs[i]+=costs[idx] # 累積和をとる
        dfs(i) # 再帰処理
    return

dfs(0)
print(*costs)

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)


N, M = map(int, input().split())
G = [[] for _ in [0]*N]
for _ in [0]*(N-1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    G[a].append(b)
    G[b].append(a)

add = [0]*N
for _ in [0]*M:
    p, x = map(int, input().split())
    p -= 1
    add[p] += x
counter = [0]*N


def dfs(v, p, x):
    counter[v] = x
    for u in G[v]:
        if u == p:
            continue
        dfs(u, v, x+add[u])


dfs(0, -1, add[0])

print(*counter)

Submission status: Runtime Error

Solution code:
X=int(input())
a=input()
if x>=3200:
  print(a)
else:
  print('red')

Submission status: Runtime Error

Solution code:
a=int(input())
s=int(input())
if a>=3200:
  print(s)
else:
  print('red')

Submission status: Runtime Error

Solution code:
a = int(input())
s = input()

if a>=3200:
  print(s)
 else :
   print("red")

Submission status: Runtime Error

Solution code:
int a
str s
a = int(input())
s = str(input())

if a>=3200:
  print("s")
  else :
    print("red")

Submission status: Runtime Error

Solution code:
a = int(input())
s = str(input())

if a>=3200:
  print("s")
  else :
    print("red")

Submission status: Runtime Error

Solution code:
a = int(input())
s = str(input())

if a>=3200:
  print("s")
  else :
    print("'red'")

Submission status: Runtime Error

Solution code:
a = int(input())
s = int(input())
if a >= 3200:
    print('s')
if a < 3200:
    print('red')

Submission status: Runtime Error

Solution code:
# aが3200以上ならsと出力し、aが3200 未満なら red と出力す
if a>=3200 
    print's'
elif a<3200
    print'red'

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int, input().split()))
s = 0
for i in range(n):
    s += 1 / a[i]
print(1 / s)

Submission status: Runtime Error

Solution code:
a=int(input())
s=int(input())

if a >= 3200:
    print(s)
else:
    print("red")

Submission status: Runtime Error

Solution code:
a = int(input())
s = input()

if a >= 3200:
  print(s)
 else:
  print('red')

Submission status: Runtime Error

Solution code:
a=int(input())
s=int(input())
if a<3200:
  print("red")
else:
  print(s)

Submission status: Runtime Error

Solution code:
def MI():
    return map(int, input().split())

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

a = int(input())
s = int(input())

print("s" if a >= 3200 else "red")

Submission status: Runtime Error

Solution code:
def main():
    n,q = map(int,input().split())
    node = [[]for _ in range(n)]
    looked = [1]*n
    for i in range(n-1):
        a,b = map(int,input().split())
        node[b-1].append(a-1)
        node[a-1].append(b-1)
    counter = [0]*n
    for i in range(q):
        p,x = map(int,input().split())
        counter[p-1] += x
    queue = [0]
    looked[0] = 0
    while(queue):
        now = queue.pop(0)
        for i in node[now]:
            if looked[i]:
                queue.append(i)
                counter[i] += counter[now]
                looked[i] = 0
    print(*counter)
main()

Submission status: Runtime Error

Solution code:
a = int(input())
s = int(input())

if a >= 3200:
  print(s)
else:
  print("red")

Submission status: Runtime Error

Solution code:
a = int(input())
s = int(input())

if a > 3200:
  print(s)
else:
  print("red")

Submission status: Runtime Error

Solution code:
from collections import deque

N, Q = map(int, input().split(' '))
tree = [[] for i in range(N + 1)]
for i in range(N - 1):
    a, b = map(int, input().split(' '))
    tree[a].append([a, b])
    tree[b].append([b, a])
val = [0] * (N + 1)
for i in range(Q):
    p, x = map(int, input().split(' '))
    val[p] += x
ans = [-1] * (N + 1)
ans[1] = val[1]
bfs = deque(tree[1])
while bfs:
    p, n = bfs.popleft()
    if ans[n] == -1:
        ans[n] = val[n] + ans[p]
        for i in tree[n]:
            bfs.append(i)
for i in ans[1:-1]:
    print(i,'',end="")
print(ans[-1])

Submission status: Runtime Error

Solution code:
n = int(input())
s = input()
print(s if s >= 3200 else "red")

Submission status: Runtime Error

Solution code:
import sys
from collections import defaultdict
readline = sys.stdin.buffer.readline
#sys.setrecursionlimit(10**8)


def geta(fn=lambda s: s.decode()):
    return map(fn, readline().split())


def gete(fn=lambda s: s.decode()):
    return fn(readline().rstrip())


def main():
    a = gete(int)
    s = gete()

    if s < 3200:
        print(a)
    else:
        print('red')


if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
a, s = input().split()
print(s if int(a) >= 3200 else "red")

Submission status: Runtime Error

Solution code:
# REになった
# 各ルートの4方向で行ってないところを覚えるのではなく、すでに行ったマスのみをマークするようにする
# line input as int generator
def li():
    return map(int, input().split())


H, W = li()
# C = [input().split() for _ in range(H)]
C = [['' for _ in range(W)] for _ in range(H)]
# すでに行った道など、もう通らない道
route = []
for h in range(H):
    for w, c in enumerate(input()):
        C[h][w] = c
        if c == '#':
            route.append((h,w))
        # if h-1 >= 0:
        #     route[(h, w)].append((h - 1, w))
        # if h+1 < H:
        #     route[(h, w)].append((h + 1, w))
        # if w-1 >= 0:
        #     route[(h, w)].append((h, w - 1))
        # if w+1 < W:
        #     route[(h, w)].append((h, w + 1))
        if c == 's':
            start = (h, w)
# print(route)

def dfs(now):
    h, w = now
    # print(now)
    # if not ((0 <= h < H) and (0 <= w < W)):
    #     return False
    # print(route[now])
    if (h,w) in route:
        return False
    if C[h][w] == 'g':
        # OK!
        return True
    # elif C[h][w] == '#':
    #     return False
    else:
        # append
        route.append((h,w))
        if h-1 >= 0 and ((h-1,w) not in route):
            if dfs((h-1,w)):
                return True
        if h+1 < H and ((h+1,w) not in route):
            if dfs((h+1,w)):
                return True
        if w-1 >= 0 and ((h,w-1) not in route):
            if dfs((h,w-1)):
                return True
        if w+1 < W and ((h,w+1) not in route):
            if dfs((h,w+1)):
                return True
        return False

print('Yes' if dfs(start) else 'No')

Submission status: Runtime Error

Solution code:
a = int(input())
2 s = input()
3 print(s if a >= 3200 else 'red')

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(10**6)
n,q = map(int,input().split())
tree = [[] for _ in range(n)]
for i in range(n-1):
    a,b = map(int,input().split())
    tree[a-1].append(b-1)
    tree[b-1].append(a-1)
ans = [0]*n
for i in range(q):
    p,x = map(int,input().split())
    ans[p-1] += x
done = [0]*n
def dfs(now,m):
    done[now] = 1
    ans[now] += m
    for i in tree[now]:
        if not done[i]:
            dfs(i,ans[now])
dfs(0,0)
print(*ans)

Submission status: Runtime Error

Solution code:
s=int(input())
t=input()

if a>=3200:
  print(s)
else:
  print('red')

Submission status: Runtime Error

Solution code:
a = int(input())
s = input()

if a>= 3200:
  print(S)
else:
  print('red')

Submission status: Runtime Error

Solution code:
a=input()
if a>=3200
	print("red")
else:
	b=input()
    print(b)

Submission status: Runtime Error

Solution code:
a=input()
s=input()
if a>=3200:
    print(s)
else:
    print("red")

Submission status: Runtime Error

Solution code:
print('red' if int(int(input())<3200 else input())

Submission status: Runtime Error

Solution code:
a = input().split()
s = input()
if a >= 3200:
	print(s)
else:
	print('Red')

Submission status: Runtime Error

Solution code:
n = int(intput())
s = input()

if n < 3200:
  print('red')
else :
  print(s)

Submission status: Runtime Error

Solution code:
n,q = list(map(int, input().split()))
li = [[] for i in range(n)]
ans=[0]*n


for i in range(n-1):
    a, b = list(map(int, input().split()))
    li[a-1].append(b-1)
for i in range(q):
    p, x = list(map(int, input().split()))
    ans[p-1]+=x

def dfs(now, v, p=None):
    ans[now]+=v
    for u in li[now]:
        if u== now:
            continue
        dfs(u,ans[now],now)


visited=[0]*n

dfs(0,0)
for i in ans:
    print(i)

Submission status: Runtime Error

Solution code:
a = input()
b = input()
if a < 3200:
  print('red')
  else:
    print('b')

Submission status: Runtime Error

Solution code:
a = input()
b = input()
if a < 3200:
  print(red)
  else:
    print(b)

Submission status: Runtime Error

Solution code:
a = int(input())
s = int(input())

if a>=3200:
    print(s)
else:
    print('red')

Submission status: Runtime Error

Solution code:
a = int(input())
s = int(input())
# C = int(input())
# b = input()
print(s if a >= 3200 else "red")

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(10**8)
input = sys.stdin.readline 
n,q=map(int,input().split())
Graph=[[] for _ in range(n+1)]
ans=[0 for _ in range(n+1)]
seen=[False for _ in range(n+1)]

for _ in range(n-1):
    a,b=map(int,input().split())
    Graph[a].append(b)
    Graph[b].append(a)

for _ in range(q):
    p,x=map(int,input().split())
    ans[p]+=x

def dfs(v):
    seen[v]=True
    for nv in Graph[v]:
        if seen[nv]:
            continue
        else:
            ans[nv]+=ans[v]
            dfs(nv)

dfs(1)
print(*ans[1:])

Submission status: Runtime Error

Solution code:
N=int(input())
L=list(map(int,input().split()))
m=[]
for i in L:
  a=1/i
  m.append(a)
S=sum(m)
print(1/S)

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a;
  string s;
  cin >> a >> s;
  if(a < 3200)
  cout <<"red";
  else
  cout << s;
}

Submission status: Runtime Error

Solution code:
N = int(input())
V = sorted(list(map(int,input().split())))



for i in range(N-1):
    V[0] = (V[0] + V.pop(1))/2

print(V[0])

Submission status: Runtime Error

Solution code:
a = int(input())
s = input()
if a>=3200:
    print(s)
else:
    print(red)

Submission status: Runtime Error

Solution code:
import collections,sys
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
N,Q = LI()
ab = [LI() for _ in [None]*(N-1)]
px = [LI() for _ in [None]*(Q)]
ans = [0]*(N+1) #1_index
graph = [collections.deque() for _ in [None]*(N+1)] #1_index
for a,b in ab:
        graph[a].append(b)
        graph[b].append(a)
for p,x in px:
    ans[p] += x
seen = [0]*(N+1) #1_index
stack = []
def dfs():
    seen[1] = 1
    stack.append(1)
    while stack:
        s = stack.pop()
        if not graph[s]:
            continue
        for j in range(len(graph[s])):
            g_NO = graph[s].popleft()
            if seen[g_NO]:
                continue
            seen[g_NO] = 1
            stack.append(g_NO)
            ans[g_NO] += ans[s]
dfs()
print(*ans[1:])

Submission status: Runtime Error

Solution code:
import collections,sys
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
N,Q = LI()
ab = [LI() for _ in range(N-1)]
px = [LI() for _ in range(Q)]
ans = [0]*(N+1) #1_index
graph = [collections.deque() for _ in range(N+1)] #1_index
for a,b in ab:
        graph[a].append(b)
        graph[b].append(a)
for p,x in px:
    ans[p] += x
seen = [0]*(N+1) #1_index
stack = []
def dfs():
    seen[1] = 1
    stack.append(1)
    while stack:
        s = stack.pop()
        if not graph[s]:
            continue
        for j in range(len(graph[s])):
            g_NO = graph[s].popleft()
            if seen[g_NO]:
                continue
            seen[g_NO] = 1
            stack.append(g_NO)
            ans[g_NO] += ans[s]
dfs()
print(*ans[1:])

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input().split()))
a = 0
for i in range(N):
  a = a + (1/A[i])
  
print(1/a)

Submission status: Runtime Error

Solution code:
a,s=map(int,input().split())
if a>=3200:
    print(s)
else:
    print("red")

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline
n, q = map(int, input().split())
cnt = [0] * n
tree = [[] for i in range(n)]
for i in range(n - 1):
    a, b = map(int, input().split())
    tree[a - 1].append(b - 1)
    tree[b - 1].append(a - 1)

for i in range(q):
    p, x = map(int, input().split())
    cnt[p - 1] += x

def dfs(cur, par):
    for chi in tree[cur]:
        if chi == par:
            continue
        cnt[chi] += cnt[cur]
        dfs(chi, cur)
dfs(0, -1)
print(*cnt)

Submission status: Runtime Error

Solution code:
N, Q = map(int, input().split())
edge = [[] for _ in range(N)]
for i in range(N-1):
    a,b = map(int, input().split())
    edge[a-1].append(b-1)
    edge[b-1].append(a-1)

ans = [0]*N
for i in range(Q):
    p, x = map(int, input().split())
    ans[p-1] += x

from collections import deque

visited = [False]*N
d = deque([0])
while len(d)>0:
    v = d.popleft()
    visited[v]= True
    for u in edge[v]:
        if visited[u]==False:
            ans[u] += ans[v]
            visited[u]=True
            d.append(u)

print(*ans, sep=' ')

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; ++i)
using namespace std;
typedef long long ll;

int main() {
    int a;
    string s;
    cin >> a >> s;
    if (a >= 3200) cout << s << endl;
    else cout << "red" << endl;
    return 0;
}

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(10**7)
N, Q = map(int, input().split())
to = [[] for _ in range(N)]
ans = [0] * N
def dfs(v, p=-1):
    for u in to[v]:
        if u == p:
            continue
        ans[u] += ans[v]
        dfs(u, v)
for _ in range(N-1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    to[a].append(b)
    to[b].append(a)
for _ in range(Q):
    p, x = map(int, input().split())
    p -= 1
    ans[p] += x
dfs(0)
print(*ans)

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(300000) #上限上げないと引っかかる
n,q = map(int, sys.stdin.readline().rstrip().split())
sco = [0]*(n+1)
G =[[] for _ in range(n+1)]
for i in range(n-1):
    a,b = map(int, sys.stdin.readline().rstrip().split())
    G[a].append(b)
    G[b].append(a)

for j in range(q):
    p,x = map(int, sys.stdin.readline().rstrip().split())
    sco[p]+=x


#本体
seen = [False for _ in range(n+1)]
def dfs(G,V,score):
    global sco
    sco[V] +=score

    seen[V] = True
    for next_V in G[V]:
        if (seen[next_V]):
            continue
        dfs(G, next_V,sco[V])

#入力受け取り
#例
dfs(G,1,0)
print(*sco[1:])
#単にdfs(G,0)だと、木構造でないとき(頂点1つでない時)不正解

Submission status: Runtime Error

Solution code:
a=input()
b=input()
if a>=3200:
	print(b)
else:
  print("red")

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(10**6)
def dfs(G,v,p):
    for nv in G[v]:
        if(nv==p):
            continue
        point[nv]+=point[v]
        dfs(G,nv,v)

N,Q=map(int,input().split())
G=[[] for i in range(N)]
for i in range(N-1):
    a,b=map(lambda x:int(x)-1,input().split())
    G[a].append(b)
    G[b].append(a)
point=[0]*N
for i in range(Q):
    p,x=map(int,input().split())
    point[p-1]+=x
dfs(G,0,-1)
print(*point)

Submission status: Runtime Error

Solution code:
a = input()
s = input()

if a>=3200:
  print(s)
else:
  print("red")

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(10 ** 6)
def input():
    return sys.stdin.readline()[:-1]

N,Q=map(int,input().split())
graph=[[]for _ in range(N)]
point=[0]*N
for _ in range(N-1):
    a,b=map(int,input().split())
    graph[a-1].append(b-1)
    graph[b-1].append(a-1)
for _ in range(Q):
    a,b=map(int,input().split())
    a=a-1
    point[a]=point[a]+b

def dfs(now,prev=-1):
    for next in graph[now]:
        if next==prev:
            continue
        point[next]=point[next]+point[now]
        dfs(next,now)
dfs(0)
print(*point)

Submission status: Runtime Error

Solution code:
def main():
    a = int(input())
    s = input()
    if a >= 3200:
        pritn(s)
    else:print("red")

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
from collections import deque
N,Q= map(int, input().split())
tree = [[] for _ in range(N)]
counter = [0]*N
visited = [False]*N
q = deque([0])

for i in range(N-1):
    a,b = map(int, input().split())
    tree[a-1].append(b-1)
    tree[b-1].append(a-1)

for i in range(Q):
    p,x = map(int, input().split())
    counter[p-1] += x

while q:
    parent = q.popleft()
    visited[parent] = True
    for child in tree[parent]:
        if visited[child]:
            continue
        counter[child] += counter[parent]
        q.append(child)
print(*counter)

Submission status: Runtime Error

Solution code:
a = int(input())
s = input()

if a >= 3200:
  print(S)
else:
  print("red")

Submission status: Runtime Error

Solution code:
a = int(input())
s = input()

if s >= 3200:
    print(s)
else:
    print("red")

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value

## BFS

#入力受け取り
N, Q = mi()
x = li2(N-1)

cnt = [0]*(N+1)
for i in range(Q):
    p0, p1 = mi()
    cnt[p0] += p1

#隣接リスト作成
adj = [[] for i in range(N+1)]
for i in range(N-1):
    #x[i][0] -= 1
    #x[i][1] -= 1
    adj[x[i][0]].append(x[i][1])
    adj[x[i][1]].append(x[i][0])

global ans
ans = [0]*(N+1)

def dfs(fr, nx):
    ans[nx] += ans[fr] + cnt[nx]
    for v in adj[nx]:
        if v != fr:
            dfs(nx, v)

dfs(1, 1)

for i in range(1, N+1):
    print(ans[i], '', end='')

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value

## BFS

#入力受け取り
N, Q = mi()
x = li2(N-1)

cnt = [0]*N
for i in range(Q):
    p0, p1 = mi()
    cnt[p0-1] += p1

#隣接リスト作成
adj = [[] for i in range(N)]
for i in range(N-1):
    x[i][0] -= 1
    x[i][1] -= 1
    adj[x[i][0]].append(x[i][1])
    adj[x[i][1]].append(x[i][0])

global ans
ans = [0]*N

def dfs(fr, nx):
    ans[nx] += ans[fr] + cnt[nx]
    for v in adj[nx]:
        if v != fr:
            dfs(nx, v)

dfs(0, 0)

for k in ans:
    print(k, '', end='')

Submission status: Runtime Error

Solution code:
import sys
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]
import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
'''
from collections import deque
N, Q = mi()
D = li2(N-1)
px = li2(Q)
que = deque()

adj = [[] for i in range(N+1)]

for i in range(N-1):
    adj[D[i][0]].append(D[i][1])

ans = [0]*(N+1)
for j in range(Q):
    ind, a = px[j][0], px[j][1]
    que.append(ind)
    while(que!=deque()):
        v = que.popleft()
        ans[v] += a
        for e in adj[v]:
            que.append(e)


for i in range(1, N+1):
    print(ans[i], ' ', end='')
'''

from collections import deque
sys.setrecursionlimit(10**9)

#DFS
def dfs(x):
    if flag[x]:
        return
    else:
        flag[x] = 1
        for a in adj[x]:
            dfs(a)
        global ans
        ans.appendleft(x)

#入力受け取り
N, Q = mi()
x = li2(N-1)
p = li2(Q)

#隣接リスト作成
adj = [[] for i in range(N)]
for i in range(N-1):
    x[i][0] -= 1
    x[i][1] -= 1
    adj[x[i][0]].append(x[i][1])
'''
#DFSを利用したトポロジカルソート
flag = [0]*N
ans = deque([])
for i in range(N):
    dfs(i)
#print(ans)
'''
cnt = [0]*N
for i in range(Q):
    #ind = bisect.bisect_left(ans, p[i][0]-1)
    cnt[p[i][0]-1] += p[i][1]

#print(adj)
#print(cnt)
que = deque()
kotae = [0]*N

for a in range(N):
    que.append(a)
    kotae[a] += cnt[a]
    while que!=deque():
        v = que.popleft()
        for next in adj[v]:
            que.append(next)
            kotae[next] += cnt[a]

for k in kotae:
    print(k, '', end='')

Submission status: Runtime Error

Solution code:
a = int(input())
s  = str(input())
if n >= 3200:
  print(s)
else:
  print('red')

Submission status: Runtime Error

Solution code:
a = int(input())
s  = input()
if n >= 3200:
  print(s)
else:
  print('red')

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline
n,q = [int(i) for i in input().split()]

def find(x):
    if par[x][0] < 0:
        return x
    else:
        px = find(par[x][0])
        par[x][0] = px
        return px

def unite(x,y):      
    x = find(x)
    y = find(y)
    if x == y:
        return False
    else:
        #sizeの大きいほうがx
        if par[x][0] > par[y][0]:
            x,y = y,x
        par[x][0] += par[y][0]
        par[y][0] = x
        return True

memo = [True]*n
par = [[-1,0,i] for i in range(n)]
for i in range(n-1):
  a,b = [int(i) for i in input().split()]
  unite(a-1,b-1)
  if memo[a-1] and memo[b-1]:
      par[b-1][1] += 1
  elif memo[b-1] and not memo[a-1]:
    par[b-1][1] += 1+par[a-1][1]
  elif memo[a-1] and not memo[b-1]:
    par[a-1][1] += 1+par[b-1][1]
  memo[a-1] = False
  memo[b-1] = False
  
chk = [0]*n
for i in range(q):
  p,x = [int(i) for i in input().split()]
  chk[p-1] += x

from operator import itemgetter
par = sorted(par,key=itemgetter(1))
par = sorted(par,key=itemgetter(0))
#print(par)
cnt = 0
for i in range(1,n):
  if par[i][0] >= 0 and par[i][1]==1:
    chk[par[i][2]] += chk[par[i][0]]
    cnt = 0
  if par[i][0] >= 0 and par[i][1]>=2:
    if par[i][0] == par[i-1][0] and par[i][1] > par[i-1][1]:
      chk[par[i][2]] += chk[par[i-1][2]]
      cnt = 0
    if par[i][0] == par[i-1][0] and par[i][1] == par[i-1][1]:
      cnt += 1
      chk[par[i][2]] += chk[par[i-1-cnt][2]]
      
chk = list(map(str,chk))
print(' '.join(chk))

Submission status: Runtime Error

Solution code:
N = int(input())
v = sorted(list(map(int, input().split())))
for i in range(N-1):
    a = (v[i]+v[i+1])/2
    v[i+1] = float(a)
    a = 0
print(v[-1])

Submission status: Runtime Error

Solution code:
N = int(input())
v = sorted(list(map(int, input().split())))
for i in range(N):
    a = (v[i]+v[i+1])/2
    v[i+1] = int(a)
    v[i] = 'A'
    a = 0
print(v[-1])

Submission status: Runtime Error

Solution code:
a = inptu()
s = input()

answer = s if a >= 3200 else 'red'

print(answer)

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
    
# 遅延評価で加えてあげるだけ
    
N,Q = map(int,input().split())
AB = [[int(x) for x in input().split()] for _ in range(N-1)]
PX = [[int(x) for x in input().split()] for _ in range(Q)]
    
graph = [[] for _ in range(N+1)]
for a,b in AB:
    graph[a].append(b)
    graph[b].append(a)
    
value = [0] * (N+1)
for p,x in PX:
    value[p] += x
    
def dfs(v,parent,add):
    value[v] += add
    for x in graph[v]:
        if x == parent:
            continue
        dfs(x,v,value[v])
    
dfs(1,0,0)
    
answer = ' '.join(map(str,value[1:]))
print(answer)

Submission status: Runtime Error

Solution code:
a = input()
s = input()
if a >= 3200:
  print(s)
else:
  print('red')

Submission status: Runtime Error

Solution code:
from collections import deque
from collections import Counter
from itertools import product, permutations,combinations
from operator import itemgetter
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right, bisect
#pypyではscipy, numpyは使えない
#from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson, minimum_spanning_tree
#from scipy.sparse import csr_matrix, coo_matrix, lil_matrix
#import numpy as np
from fractions import gcd
from math import ceil,floor, sqrt, cos, sin, pi, factorial
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**8)
INF = float('inf')

def main():
  a = int(read())
  s = input()
  if a<3200:
    print('red')
  else:
    print(s)
  
  
if __name__ == '__main__':
  main()

Submission status: Runtime Error

Solution code:
from collections import deque
from collections import Counter
from itertools import product, permutations,combinations
from operator import itemgetter
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right, bisect
#pypyではscipy, numpyは使えない
#from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson, minimum_spanning_tree
#from scipy.sparse import csr_matrix, coo_matrix, lil_matrix
#import numpy as np
from fractions import gcd
from math import ceil,floor, sqrt, cos, sin, pi, factorial
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**8)
INF = float('inf')

def main():
  a = int(read())
  s = read()
  if a<3200:
    print('red')
  else:
    print(s)
  
  
if __name__ == '__main__':
  main()

Submission status: Runtime Error

Solution code:
a = int(input)
s = input()

if a >= 3200:
  print('red')
else:
  print(s)

Submission status: Runtime Error

Solution code:
a, s =input().split()
a=int(a)

if a>=3200:
    print(s)
else:
    print('red')

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(10**6)
n,q = map(int, input().split())
e = [[] for i in range(n)]
for i in range(n-1):
    a,b = map(int, input().split())
    e[a-1].append(b-1)
    e[b-1].append(a-1)
ans = [0]*n
for i in range(q):
	p,x = map(int,input().split()) 
	ans[p-1] += x

def dfs(i = 0, r = -1):
    for j in e[i]:
        if j != r:
            ans[j] += ans[i]
            dfs(j, i)
dfs()
print(*ans)

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(10**6)
n,q = map(int, input().split())
e = [[] for i in range(n)]
for i in range(n-1):
    a,b = map(int, input().split())
    e[a-1].append(b-1)
    e[b-1].append(a-1)
ans = [0]*n
for i in range(q):
    p,x = map(int,input().split()) 
    ans[p-1] += x

def dfs(i = 0, r = -1):
    for j in e[i]:
        if j != r:
            ans[j] += ans[i]
            dfs(j, i)
dfs()
print(*ans)

Submission status: Runtime Error

Solution code:
from math import sqrt
n = int(input())
cnt = 0
for i in range(1, n):
    for i in range(2, int(sqrt(n)) + 1):
        if i % j == 0:
            continue
    cnt += 1
print(cnt)

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(1000000)


class CountTree:
    def __init__(self, relations):
        self.relations = relations
        self.desc = [set() for _ in range(len(relations))]
        self._find_desc([1])
        self.counter = [0] * len(relations)

    def _find_desc(self, done, v=1):
        for desc in self.relations[v]:
            if desc in done:
                continue
            done.append(desc)
            self.desc[v].add(desc)
            self._find_desc(done, desc)

    def inc(self, p, x):
        self.counter[p] += x
        for d in self.desc[p]:
            self.inc(d, x)

    def p_cnt(self):
        print(*self.counter[1:])


N, Q = map(int, input().split())
relations = [None] + [set() for _ in range(N)]
for _ in range(N - 1):
    ai, bi = map(int, input().split())
    relations[ai].add(bi)
    relations[bi].add(ai)
ct = CountTree(relations)
for _ in range(Q):
    pi, xi = map(int, input().split())
    ct.inc(pi, xi)
ct.p_cnt()

Submission status: Runtime Error

Solution code:
a = int(ipnut())
s = str(input())
if a >= 3200:
    print(s)
else:
    print('red')

Submission status: Runtime Error

Solution code:
a=int(input())
S=input()

if(A>=3200):
  print(S)
else:
  print("red")

Submission status: Runtime Error

Solution code:
a=Int(input())
S=input()

if(A>=3200):
  print(S)
else:
  print("red")

Submission status: Runtime Error

Solution code:
n,q=map(int,input().split())
neighbor=[[]  for _ in range(n+1)]
ans=[0]*(n+1)

for _ in range(n-1):
    a,b=map(int,input().split())
    neighbor[a].append(b)
    neighbor[b].append(a)


for _ in range(q):
    p,x=map(int,input().split())
    ans[p]+=x

visit=[True]*(n+1)
tmp=[1]
for x in tmp:
    visit[x]=False
    for y in neighbor[x]:
        if visit[y]:
            tmp.append(y)
            ans[y]+=ans[x]

print(*ans[1:])

Submission status: Runtime Error

Solution code:
N = int(input())
v = list(map(int,input().split()))
v.sort()
ans=v[0]
for i in v[1:]:
    ans=(ans+i)/2
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
v = list(map(int,input().split()))
v1 = v.sort()
ans=v1[0]
for i in v[1:]:
    ans=(ans+i)/2
print(ans)

Submission status: Runtime Error

Solution code:
a=int(input())
s-input()
if a>=3200:
    print(s)
else:
    print("red")

Submission status: Runtime Error

Solution code:
print(red if int(input()) < 3200 else input())