Problem:


Score : 100 points

Problem Statement

Snuke is giving cookies to his three goats.

He has two cookie tins. One contains A cookies, and the other contains B cookies. He can thus give A cookies, B cookies or A+B cookies to his goats (he cannot open the tins).

Your task is to determine whether Snuke can give cookies to his three goats so that each of them can have the same number of cookies.

Constraints

1 \leq A,B \leq 100

Both A and B are integers.

Input

Input is given from Standard Input in the following format:

A B

Output

If it is possible to give cookies so that each of the three goats can have the same number of cookies, print Possible; otherwise, print Impossible.

Sample Input 1

4 5

Sample Output 1

Possible

If Snuke gives nine cookies, each of the three goats can have three cookies.

Sample Input 2

1 1

Sample Output 2

Impossible

Since there are only two cookies, the three goats cannot have the same number of cookies no matter what Snuke gives to them.



Sample input:
4 5


Sample output:
Possible

Submission status: Runtime Error

Solution code:
a,b = map(int, input())
if a%3 and b%3 and (a+b)%3:
  print("Impossible")
else:
  print("Possible")

Submission status: Runtime Error

Solution code:
import itertools

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

s = sum(a)
ac = list(itertools.accumulate(a))
print(ac)

ans = 10**20

for i in range(n-1):
  ans = min(ans,abs(ac[i]*2-s))
  
print(ans)

Submission status: Runtime Error

Solution code:
data = list(map(int, input().split())

if data[0]%3==0 or data[1]%3==0 or (data[0]+data[1])%3==0:
    print("Possible")
else:
    print("Impossible")

Submission status: Runtime Error

Solution code:
a,b=map(int, input().split()) 
if (a+b)%3 ==0 or a%==0 or b%==0:
    print("Possible")
else:
    print("Impossible")

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
if a%3==0 or b%3==0 or (a+b)%==0:
    print('Possible')
else:
    print('Impossible')

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
if a%3==0 or b%3==0 of (a+b)%==0:
    print('Possible')
else:
    print('Impossible')

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
if a%3==0 or b%==0 of (a+b)%==0:
    print('Possible')
else:
    print('Impossible')

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
if a % 3 == 0 or b % 3 == 0 or (a+b) % 3 == 0:
  print("Possible")
else:
  Print("Impossible")

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
if a%3 ==0:
  print('Possible')
elif b%3 ==0:
  print('Possible')
elif (a+b)%3 ==0:
  print('Possible')
else
  print('Impossible')

Submission status: Runtime Error

Solution code:
N, K = map(int, input().split())
L = [int(l) for l in input().split()]
L.sort(reverse=True)

print(sum(L[0:K:]))

Submission status: Runtime Error

Solution code:
N = int(input())
I = list(map(int, input().split()))
minX = 10000000000
start = 0
for i in range(1, len(I)):
  start += I[i-1]
  minX = min(minX, abs(start - sum(I[-i:]) ) )
  
print(minX)

Submission status: Runtime Error

Solution code:
N = int(input())
I = list(map(int, input().split()))
minX = 1000000
for i in range(1, len(I)):
  minX = min(minX, abs(sum(I[:-i]) - sum(I[-i:]) ) )
  
  
print(minX)

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split()
print("Impossible" if a*b*(a+b)%3 else "Possible")

Submission status: Runtime Error

Solution code:
a = list(map(int, input().split()))
if a[0]%3==0 or a[1]%3==0 or (a[0]+a[1])%3==0:
  print(Possible)
else:
  print(Impossible)

Submission status: Runtime Error

Solution code:
a = list(map(int(), input().split()))
if a[0]%3==0 or a[1]%3==0 or (a[0]+a[1])%3==0:
  print(Possible)
else:
  print(Impossible)

Submission status: Runtime Error

Solution code:
a,b = map(int,input())
if a%3==0 or b%3==0 or (a+b)%3==0:
    print('Possible')
else:
    print('Impossible')

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split())
print("Possible" if (A+B)%3 == 0 else "Impossible")

Submission status: Runtime Error

Solution code:
a, b = int(input())
if (a % 3 == 0) or (b % 3 == 0) or ((a + b) % 3 == 0):
  ans = "Possible"
else :
  ans = "Impossible"
print(ans)

Submission status: Runtime Error

Solution code:
from collections import deque
import sys
sys.setrecursionlimit(1000000000)
N = int(input())
edges = [[] for _ in range(N)]
for _ in range(N-1):
    a, b = map(int, input().split())
    edges[a-1].append(b-1)
    edges[b-1].append(a-1)
que = deque([0])
parent = [-1]*N
parent[0] = 0
while que:
    cur = que.pop()
    for nxt in edges[cur]:
        if parent[nxt] < 0:
            parent[nxt] = cur
            que.append(nxt)
cur = N-1
route = [N-1]
while cur:
    cur = parent[cur]
    route.append(cur)
i = len(route)//2
a, b = route[i-1:i+1]
edges[a].remove(b)
edges[b].remove(a)
que = deque([0])
flag = [True]*N
score = 0
flag[0] = False
while que:
    v0 = que.pop()
    score+=1
    for v in edges[v0]:
        if flag[v]:
            que.append(v)
            flag[v] = False
if score>N//2:
    print('Fennec')
else:
    print('Snuke')

Submission status: Runtime Error

Solution code:
a, b, c = map(int, input().split())
if a % 3 == 0 and b % 3 != 0 and (a + b) % 3 != 0:
  print("Possible")
elif b % 3 == 0 and a % 3 != 0 and (a + b) % 3 != 0:
  print("Possible")
elif (a + b) % 3 == 0 and a % 3 != 0 and b % 3 != 0:
  print("Possible")
else:
  ("Inpossible")

Submission status: Runtime Error

Solution code:
a, b, c = map(int, input().split())
if a % 3 == 0 and b % 3 != 0 and (a + b) % 3 != 0:
  print("Possible")
elif b % 3 == 0 and a % 3 != 0 and (a + b) % 3 != 0:
  print("Possible")
elif (a + b) % 3 == 0 and a % 3 != 0 and a % 3 != 0:
  print("Possible")
else:
  ("Inpossible")

Submission status: Runtime Error

Solution code:
a, b, c = map(int, input().split())
if a % 3 == 0 and b % 3 != 0 and (a + b) % 3 != 0:
  print("possible")
elif b % 3 == 0 and a % 3 != 0 and (a + b) % 3 != 0:
  print("possible")
elif (a + b) % 3 == 0 and a % 3 != 0 and a % 3 != 0:

Submission status: Runtime Error

Solution code:
print('Possible' if int(input())%3==0 else 'Impossible')

Submission status: Runtime Error

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

if a%3 == 0 or b%3 == 0 or s%3 == 0:
  print('Possible')
else:
  print('Impossible)

Submission status: Runtime Error

Solution code:
A, B = input.split()
n = int(A) + int(B)
if n % 3 == 0:
    print(Possible)
else:
    print(Impossible)

Submission status: Runtime Error

Solution code:
A,B=map(int,input().split());print("YNeos"[all(A%3,B%3,(A+B)%3)::2])

Submission status: Runtime Error

Solution code:
N, K = map(int, input().split())
l = list(map(int, input().split()))
l.sort(reverse=True)
ans = []

for i in range(K):
    ans.append(l[i])
    
print(sum(ans))

Submission status: Runtime Error

Solution code:
a,b = int(input()),int(input())
print("Possible" if a*b*(a+b)%3==0 else "Impossible")

Submission status: Runtime Error

Solution code:

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

if a % 3 == 0 or b % 3 == 0 or (a+b) % 3 == 0:
    print("Possible")
else:
    print("Impossible")

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
print("Possible" if(a % 3 == 0 and b % 3 == 0 (a+b) % 3 == 0) else "Impossible")

Submission status: Runtime Error

Solution code:
N, K = map(int, input().split())
pint("Possible" if N*K*(N+K)%3==0 else "Impossible")

Submission status: Runtime Error

Solution code:
(a, b) = (int(tok) for tok in input().split())
print("Possible" if any(s % 3 == 0 for s in [a, b, a + b] else "Impossible")

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split())
orint("Possible" if a%3==0 or b%3==0 or (a+b)%3==0 else "Impossible")

Submission status: Runtime Error

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

if a % 3 == 0 or b % 3 == 0 or (a*b) % == 0 :
  print("Possible")
else:
  print("Impossible")

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split())
	if a % 3 == 0 or b % 3 == 0 or (a+b) % 3 == 0:
    	print('Possible')
    else:
        print('Impossible')

Submission status: Runtime Error

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

print('possible' if (a+b)% ==0 else 'impossible')

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split())
if a % 3 == 0 or b % 3 == 0 or (a+b) % e == 0:
    print('Possible')
else:
    print('Impossible')

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
print("Possible" iaf any([a%3==0,b%3==0,(a+b)%3==0]) else "Impossible")

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
print("Possible" if any(a%3==0,b%3==0,(a+b)%3==0) else "Impossible")

Submission status: Runtime Error

Solution code:
N, K = map(int, input().split())
l = sorted(list(map(int, input().split())), reverse=True)
print(str(sum(l[0:K])))

Submission status: Runtime Error

Solution code:
a,b=[int(x) for x in input().split()]
if (a%3==1 and b%d==1) or (a%3==2 and b%3==2):
  print('Possible')
else:
  print('Impposible')

Submission status: Runtime Error

Solution code:
A, B = list(map(int,input().split()))
if A * B % == 0:
  print("Possible")
else:
  print("Impossible")

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split())
c = a+b
if c%3 == 0:
  print('Possible')
else:
  print('Impossible
')

Submission status: Runtime Error

Solution code:
a,b = map(int, input().split())
if (a+b) % :
    print("Impossible")
else:
    print("Possible")

Submission status: Runtime Error

Solution code:
N, K = map(int, input().split())
l = list(map(int, input().split()))
l.sort(reverse=True)
ans = 0

for i in range(N):
    if K != 0:
        ans += l[i]
        K -= 1
    elif K == 0:
        break
print(ans)

Submission status: Runtime Error

Solution code:
A,B=map(int,input().split())

if A%3==0 or B%3== or (A+B)%3==0:
  print("Possible")
else:
  print("Impossible")

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;

int main() {
int A,B;
  cin >>A>>B;
  if(A%3==0 ||B%3==0 ||(A+B)%3==0){
    cout <<"Possible";
  }
  else{
    cout <<"Impossible";}

}

Submission status: Runtime Error

Solution code:
N = int(input())
l = list(map(int,input().split()))
sum_s= 0
sum_a = 0
diff = 100*100
for a in range(len(l)-1):
    sum_s = sum(l[:a+1])
    sum_a = sum(l[a+1:])
    if diff > abs(sum_s - sum_a):
        diff = abs(sum_s - sum_a)
print(diff)

Submission status: Runtime Error

Solution code:
N = int(input())
l = list(map(int,input().split()))
Sum = sum(l)
print(Sum)
a = Sum/2
b = 0
c = 0
if Sum > 0:
    for i in range(len(l)):
        b += l[i]
        if b > a:
            c = b - l[i]
            break
if Sum < 0:
    for i in range(len(l)):
        b += l[i]
        if b < a:
            c = b - l[i]
            break
if c == 0:
    c = l[0]
print(abs(c-(Sum-c)))

Submission status: Runtime Error

Solution code:
N,K=map(int,input().split(" "))
nums=map(int,input().split(" "))
nums=sorted(nums,reverse=True)
print(sum(nums[0:K]))

Submission status: Runtime Error

Solution code:
N,K = map(int,input().split())
l   = list(map(int,input().split()))
l.sort()
l.reverse()
Sum = 0
for i in range(K):
    Sum+=l[i]
print(Sum)

Submission status: Runtime Error

Solution code:
N,K = map(int,input().split())
l = list(map(int,input().split()))
ans = 0
sorted(l)
for i in range(K):
  ans += l[n-i-1]
print(ans)

Submission status: Runtime Error

Solution code:
N,K = map(int,input().split())
l = list(map(int,input().split()))
ans = 0
sorted(l)
for i in range(K):
  ans += l[n-i+1]
print(ans)

Submission status: Runtime Error

Solution code:
N,K = map(int,input().split())
l = list(map(int,input().split()))
ans = 0
l.sort()
for i in range(K):
  ans += l[i]
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
list_a = list(map(int, input().split(" ")))

min_diff = 10**9
for i in range(len(list_a)-1):
    sunuke = sum(list_a[:i+1])
    arai = sum(list_a[i+1:])
    diff = abs(sunuke - arai)
    if min_diff > diff:
        min_diff = diff

print(min_diff)

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(300000)


def solve(N: int, a: "List[int]", b: "List[int]"):
    conn = [[] for _ in range(N)]
    for i in range(N - 1):
        conn[a[i] - 1].append(b[i] - 1)
        conn[b[i] - 1].append(a[i] - 1)

    def dfs(idx, cur, conn, dis):
        dis[idx] = cur
        for nex in conn[idx]:
            if dis[nex] is None:
                dfs(nex, cur + 1, conn, dis)
        return None

    f_dis = [None] * N
    f_dis[0] = 0
    dfs(0, 0, conn, f_dis)

    s_dis = [None] * N
    s_dis[N - 1] = 0
    dfs(N - 1, 0, conn, s_dis)

    cnt = 0
    for i in range(N):
        if f_dis[i] <= s_dis[i]:
            cnt += 1

    if cnt > (N - cnt):
        ret = 'Fennec'
    else:
        ret = 'Snuke'
    print(ret)
    return


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
    a = [int()] * (N-1)  # type: "List[int]" 
    b = [int()] * (N-1)  # type: "List[int]" 
    for i in range(N-1):
        a[i] = int(next(tokens))
        b[i] = int(next(tokens))
    solve(N, a, b)

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
A,B=map(int,input().split())
if A%3==0 or B%3==0 or (A+B)%3==0:
    print(Possible)
else:
    print(Impossible)

Submission status: Runtime Error

Solution code:
a,b=map(int,input())
if a%3==0 or b%3==0 or (a+b)%3==0:
 print("Possible")
else:
 print("Impossible")

Submission status: Runtime Error

Solution code:
N,K = map(int, input().split())
ans = 0
l = [int(i) for i in input().split()]
l = sorted(l, reverse=True)
for i in range(K):
    ans += l[i]
print(ans)

Submission status: Runtime Error

Solution code:
N, K = map(int, input().split())
ls = list(map(int, input().split()))

print(sum(sorted(ls, reverse=True)[:K]))

Submission status: Runtime Error

Solution code:
a, b = [ int(input()) for i in input().split() ]
ans = "Impossible"
if a % 3 == 0 or b % 3 == 0 or (a+b) % 3 == 0:
  ans = "Possible"
print(ans)

Submission status: Runtime Error

Solution code:
n,k=int(input().split())
if (n+k)%3 == 0:
  print("Possible")
else:
  print("Impossible")

Submission status: Runtime Error

Solution code:
# https://atcoder.jp/contests/abc067/tasks/abc067_a

import itertools
from collections import Counter
from collections import defaultdict
import bisect

def main():
    A, B = map(int, input().split())
    if A % 3 == 0 or B % 0 == 0 or (A + B) % 3 == 0:
        print('Possible')
    else:
        print('Impossible')


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
A,B=input().split(" ")
print("Impossible" if A*B*(A+B)%3 else "Possible")

Submission status: Runtime Error

Solution code:
A,B=map(int,input().split());print(("Possible","Impossible")[min([A%3,B%3,(A+B)%3])]

Submission status: Runtime Error

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

if (a+b)%3==0: 
  print("Possible")
elif:
  print("Impossible")

Submission status: Runtime Error

Solution code:
#include <iostream>

int main() {


	std::cin.tie(nullptr); std::ios::sync_with_stdio(false);

	int A, B; std::cin >> A >> B;


	if (A % 3 == 0 || B % 3 == 0 || (A + B) % 3 == 0)std::cout << "Possible";
	else std::cout << "Impossible";


	return 0;


}

Submission status: Runtime Error

Solution code:
A, B = map(int, input().split())
        print("No")

if A % 3 == 0 or B % 3 == 0 or (A + B) % 3 == 0:
    print("Possible")
else:
    print("Impossible")

Submission status: Runtime Error

Solution code:
A, B = maP(int, input().split())

if A % 3 == 0 or B % 3 == 0 or (A + B) % 3 == 0:
    print("Possible")
else:
    print("Impossible")

Submission status: Runtime Error

Solution code:
# coding: utf-8
# Your code here!
import math
N = int(input())
lst = list(map(int,input().split()))
x = lst[0]
y = sum(lst[1:])
ans = abs(y - x)
for i in range(1,N-1):
    x+=lst[i]
    y-=lst[i]
    ans = min(ans,abs(x-y))
print(ans)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import sys
from collections import deque

N=input()

nl=[ [] for i in range(N+1)]
D=[ 0 for i in range(N+1)]	# No.1からの距離
V=[ 0 for i in range(N+1)]	# 訪問済みフラグ

for i in range(N-1):
	a,b=map(int, sys.stdin.readline().split())
	nl[a].append(b)
	nl[b].append(a)


def bfs(v):	#1からの頂点Nまでの距離を算出
	q = deque([]) 
	V[v]=1
	q.append(v)
	while q:
		v=q.popleft()
		for i in nl[v]:
			if V[i]==0:
				D[i]=D[v]+1
				V[i]=1
				q.append(i)

bfs(1)


L=deque([]) 	#1-Nまでの最短経路を復元 
def bfs2(v):
	q = deque([]) 
	q.append(v)
	while q:
		v=q.popleft()
		for i in nl[v]:
			if D[i]==D[v]-1 and i!=1:
				q.append(i)
				L.appendleft(i)

bfs2(N)


color=[ None for i in range(N+1)]
color[1]="b"
color[N]="w"

l=len(L)
for i in range( (l+1)/2 ):
	color[ L[i] ]="b"

for i in range( (l+1)/2, l ):
	color[ L[i] ]="w"



def bfs3(v):
	q = deque([]) 
	q.append(v)
	while q:
		v=q.popleft()
		for i in nl[v]:
			if color[i] is None:
				color[i]=color[v]
				q.append(i)
for i in L:
	bfs3(i)
		


b_cnt=color.count("b")
w_cnt=color.count("w")


if N%2==1:
	if b_cnt>w_cnt:
		print "Fennec"
	else:
		print "Snuke"
else:
	if b_cnt==w_cnt:	
		print "Snuke"
	elif b_cnt>w_cnt:
		print "Fennec"
	else:
		print "Snuke"

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
if a%3==0 or b%3==0 (a+b)%3==0:
  print("Possible")
else:
  print("Impossible")

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
if a//3==0 or b//3==0 (a+b)//3==0:
  print("Possible")
else:
  print("Impossible")

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
if(a+b)%3:
  print(Impossible)
else:
  print(Possible)

Submission status: Runtime Error

Solution code:
A,B=map(int,input().split())
print(["Possible","Impossible][bool(A*B*(A+B))])

Submission status: Runtime Error

Solution code:
A,B = map(int, input().split())
print('Possible' if 0 in (A % 3 or B % 3 or (A + B) % 3) else 'Impossible')

Submission status: Runtime Error

Solution code:
A,B = map(int, input().split())
print('Possible' if (A % 3 or B % 3 or (A + B) % 3) in 0 else 'Impossible')

Submission status: Runtime Error

Solution code:
A,B = map(int, input().split())
print('Possible' if (A % 3 = 0) or (B % 3 = 0) or ((A + B) % 3 = 0) else 'Impossible')

Submission status: Runtime Error

Solution code:
A,B = map(int, input().split())
print('Possible' if A % 3 = 0 or B % 3 = 0 or (A + B) % 3 = 0 else 'Impossible')

Submission status: Runtime Error

Solution code:
A,B = map(int, input().split())
print('Possible' if (A % 3 or B % 3 or (A + B) % 3) = 0 else 'Impossible')

Submission status: Runtime Error

Solution code:
A,B = map(int, input().split())
print('Possible' if (A or B or A + B) % 3 = 0 else 'Impossible')

Submission status: Runtime Error

Solution code:
A, B = map(int, input())
print('Possible' if A+B%3==0 else 'Impossible')

Submission status: Runtime Error

Solution code:
A,B = map(int,input().split())

if (A % 3 == 0) or(B%3==0) or((A+B)%3==):
  print("Possible")
else:
  print("Impossible")

Submission status: Runtime Error

Solution code:
A, B = map(int, input().split())

if A % 3 == 0 or B % 3 == 0 or A + B % == 0:
    print('Possible')
else:
    print('Impossible')

Submission status: Runtime Error

Solution code:
a,b=(iny(x) for x in input().split())

if a%3==0 or b%3==0 or (a+b)%3==0:
    print("Possible")
else:
    print("Impossible")

Submission status: Runtime Error

Solution code:
a,b=(iny(x) for x in input().split())

if a%3==0 or b%3==0 or a+b%3==0:
    print("Possible")
else:
    print("Impossible")

Submission status: Runtime Error

Solution code:
N=int(input())
lst=[int(i) for i in input().split()]
import numpy
res=numpy.cumsum(lst)
ans=10e10
for i in range(N):
  ans=min(ans,abs(res[i]-(res[-1]-res[i])))
print(ans)

Submission status: Runtime Error

Solution code:
a,b = map(int, input().split())
if a%3=0 or b%3=0 or (a+b)%3=0:
  print("Possible")
else:
  print("Impossible")

Submission status: Runtime Error

Solution code:
from sys import stdin
a, b = [int(x) for x in stdin.readline().rstrip().split()]
if (a+b)/3:
  print('Possible')
else:
  print('Impossible')
from sys import stdin
a, b = [int(x) for x in stdin.readline().rstrip().split()]
if (a+b)%3 == 0:
  print('Possible')
else:
  print('Impossible')

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
if not (a%3orb%3or(a+b)%3):
  print('Possible')
else:
  print('Impossible')

Submission status: Runtime Error

Solution code:
A,B = map(int,input().split())
if A%3==0 or B%3==0 or (A+B)%==0:
  print('Possible')
else:
  print('Impossible')

Submission status: Runtime Error

Solution code:
a,b =map(int,input().split())
k = a%3
s = b%3
if k ==s and k != 0:
  print("Impossible)
else:
  print("Possible")

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split());print('Possible' if a%3==0 else 'Possible' if b%3==0 else 'Possible' (a+b)%3==0 else 'Impossible')

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split());print('Possible' if a%3==0 else 'Possible' if b%3==0 else 'Possible' a+b%3==0 else 'Impossible')

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;

int main(){
  int A, B;
  cin >> A >> B;

  if(A%3==0 || B%3==0 || (A+B)%2==0) cout << "Possible" << endl;
  else cout << "Impossible" << endl;
}

Submission status: Runtime Error

Solution code:
a,b=int(input().split())
if (a%3==0) || (b%3==0) || ((a+b)%3==0):
  print("Possible")
else:
  print("Impossible")

Submission status: Runtime Error

Solution code:
A,B=map(int,input())
if A%3==0 or B%3==0 or (A+B)%3==0:
  print('Possible')
else:
  print('Impossible')

Submission status: Runtime Error

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

X = sum(a)
b = [a[0]]
for i in range(1, N):
    b.append(b[i-1] + a[i])

ans = []
for i in range(1, N):
    ans.append(abs(X - 2*b[i]))

print(min(ans))

Submission status: Runtime Error

Solution code:
N = int(input())
a = list(map(int, input().split()))
ans = abs(a[0]-sum(a[1:]))
for i in range(N-1):
	x = sum(a[:i])
	y = sum(a[i:])
	if abs(x-y) < ans:
		ans = abs(x-y)
if N == 2:
	ans = abs(a[0]-a[1])
print(ans)

Submission status: Runtime Error

Solution code:
a,b,c=map(int,input().split())
print(['Impossible','Possible'][a%3==0 or b%3==0 or (a+b)%3==0])

Submission status: Runtime Error

Solution code:
A,B = map(int,input().split())
if A % 3 == 0 or B % 3 == 0or A + B % 3 == 0:
  print("Possible")
else:
  print("Impossible")

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
if a%3==0 or b%3==0 or (a+b)%3==0:
    print("Possible")
else:
    print("Impossible")a,b=int(input())
if a%3==0 or b%3==0 or (a+b)%3==0:
    print("Possible")
else:
    print("Impossible")

Submission status: Runtime Error

Solution code:
a,b=int(input())
if a%3==0 or b%3==0 or (a+b)%3==0:
    print("Possible")
else:
    print("Impossible")

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
print('Possible'if a%3==0or b%3==0or(a+b)%3==0else'Impossible')

Submission status: Runtime Error

Solution code:
if a/3 == 0 or b/3 == 0 or (a+b)/3 == 0:
  print("Possible")
else :
  print("Inpossible")

Submission status: Runtime Error

Solution code:
A, B = map(int, input().split())
if a % 3 or b % 3 or (A+B) % 3 == 0:
    print("Possible")
else:
    print("Impossible")

Submission status: Runtime Error

Solution code:
sys.setrecursionlimit(1500)

import math

def gcd(a,b):
    """Compute the greatest common divisor of a and b"""
    while b > 0:
        a, b = b, a % b
    return a

def lcm(a, b):
    """Compute the lowest common multiple of a and b"""
    return a * b / gcd(a, b)



N = int(input())

# Y,P,i
adj = {}

for i in range(N):
	adj[i] = []


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

length_from_1 = [0]*N
length_from_N = [0]*N

def dfs(s, d, visited, d_list):

	d_list[s] = d
	visited.add(s)

	for next_node in adj[s]:
		if(next_node not in visited):
			dfs(next_node, d+1, visited, d_list)

dfs(0, 0, set([]), length_from_1)
dfs(N-1, 0, set([]), length_from_N)

# [0, 1, 1, 1, 3, 2, 2]
# [2, 3, 3, 1, 1, 4, 0]

snuke = 0
fennec = 0
for i in range(N):
	if(length_from_1[i] <= length_from_N[i]):
		fennec +=1
	else:
		snuke +=1

if(fennec>snuke):
	print("Fennec")
else:
	print("Snuke")

Submission status: Runtime Error

Solution code:
f=lambda(x):x%3==0
a,b=map(int,input().split())
print(['Impossible','Possible'][f(a)or f(b)or f(a+b)])

Submission status: Runtime Error

Solution code:
num = list(map(int, input().split()))
a = num[0]
b = num[1]
c = num[2]

if a%3 == 0 or b%3 == 0 or (a+b) %3 ==0 :
	print('Possible')
else:
	print('Impossible')

Submission status: Runtime Error

Solution code:
def main():
    N = int(input())
    l = list(map(int, input().split()))
    ans = []
    X = sum(l)
    x = 0
    for i in range(N-1):
        x += l[i]
        ans.append(abs(X-2*x))
    print(min(ans))
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
def main():
    N = int(input())
    l = list(map(int, input().split()))
    ans = []
    X = sum(l)
    for i in range(N-1):
      	X = abs(X-2*l[i])
        ans.append(X)
    print(min(ans))
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
print['impossible','possible'][((a%3)+(b%3))%3==0]

Submission status: Runtime Error

Solution code:
a,b=map(int, input().split())
if ((a%3 == 0) or (b%3 == 0)) or (sum(a,b)%3== 0):
  print("Possible")
else:
  print("Impossible")

Submission status: Runtime Error

Solution code:
a,b=map(int, input().split())
if (a%3 == 0) or (b%3 == 0) or (sum(a,b)%3== 0):
  print("Possible")
else:
  print("Impossible")

Submission status: Runtime Error

Solution code:
a,b=map(int, input().split())
if a%3 == 0 or b%3 == 0 or sum(a,b)%3== 0:
  print("Possible")
else:
  print("Impossible")

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())print(('P','Imp')[a*b*(a+b)%3>0]+'ossible')

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())print(('P'if a*b*(a+b)%3<0else'Imp')+'ossible')

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())print('P'if a*b*(a+b)%3<0else'Imp'+'ossible')

Submission status: Runtime Error

Solution code:
A,B=map(int,input().split())
print('Possible' for (A+B)%3==0 or A%3==0 or B%3==0 else 'Impossible')

Submission status: Runtime Error

Solution code:
print('Possible' if (sum(list(map(int, input().split()))) % 3 == 0 else 'Impossible')

Submission status: Runtime Error

Solution code:
A = int(input('A : '))
B = int(input('B : '))

if A%3 == 0 or B%3==0 or (A+B)%3==0:
    print('Possible')

else:
    print('Impossible')

Submission status: Runtime Error

Solution code:
A,B = map(intinput().split())

if A % 3 == 0 or B % 3 == 0 or (A + B)  % 3 == 0:
  print("Possible")
else:
  print("Impossible")

Submission status: Runtime Error

Solution code:
a, b, c = map(int, input().split())

if a % 3 == 0 or b % 3 == 0 or (a + b) % 3 ==0:
  print("Possible")
else:
  print("Impossible")

Submission status: Runtime Error

Solution code:
n , k = map(int,input().split())
lis = list(map(int,input().split()))
lis = sorted(lis,reverse = True)
ans = 0
for i in range(k):
  ans += lis[i]
print(ans)

Submission status: Runtime Error

Solution code:
a, b = list(map(int, input().split()))
if(a % 3 == 0 or b % 3 ==0 or (a + b)4 5 % 3 == 0):
    print("Possible")
else:
    print("Impossible")

Submission status: Runtime Error

Solution code:
import math

num = int(input())

cards = [int(x) for x in input().split()]

res = sum(cards)
res2 = 0

judge = math.inf
if num == 2:
    judge = abs(cards[0]-cards[1])
else:
    for i in cards:
        res -= i
        res2 += i
        div = abs(res - res2)
        judge = div if div < judge else judge

print(judge)

Submission status: Runtime Error

Solution code:
print("Impossible" if sum(map(int, input.split())) % 3 else "Possible")

Submission status: Runtime Error

Solution code:
print("Impossible" if sum(map(int, input)) % 3 else "Possible")

Submission status: Runtime Error

Solution code:
#coding: utf-8
n, k = [int(i) for i in input().split()]
l  = input().split()

l.sort()
l.reverse()

re = 0
for i in range(k):
   re += int(l[i])

print(re)

Submission status: Runtime Error

Solution code:
A= map(int, input().split())
if A[0] % 3 == 0 or A[1] % 3 == 0 or (A[0] + A[1]) % 3 == 0:
    print("Possible")
else:
    print("Impossible")

Submission status: Runtime Error

Solution code:
A= int(input().split())
if A[0] % 3 == 0 or A[1] % 3 == 0 or (A[0] + A[1]) % 3 == 0:
    print("Possible")
else:
    print("Impossible")

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())
if A % 3 == 0 or B % 3 == 0 or (A + B) % 3 == 0:
  print("Possible")
else:
  print("Impossible")

Submission status: Runtime Error

Solution code:
N=int(input())
a=[int(i) for i in input().split()]
X=0
Y=0
min=10**11
for i in range(N):
  X=X+a[i]

for j in range(N-1):
  Y=Y+a[j]
  if abs(X-2*Y) <= min:
   min=abs(X-2*Y)
print(min)

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(1000000)

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



def dfs(now, cost, dic):
  dic[now] = cost
  for nx in adj[now]:
    if nx not in dic:
      dfs(nx, cost+1, dic)

dist_f = {}
dist_s = {}

dfs(0, 0, dist_f)
dfs(N-1, 0, dist_s)


f_cnt = 0
for  i in range(N):
  if dist_f[i] <= dist_s[i]:
    f_cnt += 1

if f_cnt > N-f_cnt:
  print("Fennec")
else:
  print("Snuke")

Submission status: Runtime Error

Solution code:
n=input()
a=list(map(int,input().split()))
an=[]
def aaa(i):
        b=a[i:]
        c=a[:i]
        x=sum(b)
        y=sum(c)
        return x-y
for i in range(len(a)):
    an+=[aaa(i)]
an=[abs(x) for x in an]
print(min(an))

Submission status: Runtime Error

Solution code:
        def main():
            goats =3
            n = input()
            list = [int(i) for i in input().split()]
            if (list[0]%3==0 or list[1] %3==0  or (list[0]+list[1])%3==0):
               print('Possible')
            else:
               print("Impossible")
         
         
        if __name__ == "__main__":
            main()

Submission status: Runtime Error

Solution code:
    def main():
        goats =3
        n = input()
        list = [int(i) for i in input().split()]
        if (list[0]%3==0 or list[1] %3==0  or (list[0]+list[2])%3==0):
           print('Possible')
        else:
           print("Impossible")
     
     
    if __name__ == "__main__":
        main()

Submission status: Runtime Error

Solution code:
def main():
    n, k = map(int, input().split())
    l_list = sorted([int(i) for i in input().split()], reverse=True)
    print(sum(l_list[:k]))
    

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
N, K = input().split()
l = input().split()
l = list(map(int, l))
l.sort(reverse=True)

sum = 0
for i in range(K):
  sum += l[i]

print(sum)

Submission status: Runtime Error

Solution code:
    a, b = map(int, input().split(" "))
     
    if (a%3 ==0) or (b%3 ==0) or ((a+b)%3 ==0):
        print("Possible")
    else:
        print("Impossible")

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split(" "))

if (a%3 ==0) or (b%3 ==0) or ((a+b)%3 ==0)):
    print("Possible")
else:
    print("Impossible")