Harryxun/stf_run huggingface dataset:
N = int(N)
M = int(M)
line_list = []
for i in range(M):
    line = input().split()
    new_list=[]
    for l in line:
        new_list.append(int(l))
    new_list.pop(0)
    line_list.append(new_list)
old_p_list = input().split()
p_list = []
for p in old_p_list:
    p_list.append(int(p))
#　スイッチ組み合わせ
import itertools
A = []
for n in range(N):
    A.append([True,False])
pattern_list = list(itertools.product(*A))
pattern_num = 0
for pattern in pattern_list:
    ok_flug = 1
    for i, line in enumerate(line_list):
            on_num = 0
            for l in line:
                if pattern[l-1]:
                    on_num += 1
            if on_num%2 != p_list[i]:
                ok_flug = 0
    if ok_flug == 1:
        pattern_num += 1
print(pattern_num)

### FIXED CODE ###

import itertools
N,M = input().split()
N = int(N)
M = int(M)
line_list = []
for i in range(M):
    line = input().split()
    new_list=[]
    for l in line:
        new_list.append(int(l))
    new_list.pop(0)
    line_list.append(new_list)
old_p_list = input().split()
p_list = []
for p in old_p_list:
    p_list.append(int(p))

A = []
for n in range(N):
    A.append([True,False])
pattern_list = list(itertools.product(*A))
pattern_num = 0
for pattern in pattern_list:
    ok_flug = 1
    for i, line in enumerate(line_list):
            on_num = 0
            for l in line:
                if pattern[l-1]:
                    on_num += 1
            if on_num%2 != p_list[i]:
                ok_flug = 0
    if ok_flug == 1:
        pattern_num += 1
print(pattern_num)
n = int(input())
for q in range(1, n, 7):
    if q % 4 == 0:
        print("Yes")
        exit(0)
print("No" if (q % 4 != 0) and (q % 7 != 0) else "Yes")

### FIXED CODE ###

n = int(input())
for q in range(0, n, 7):
    if q == 0:
        continue
    if (n - q) % 4 == 0:
        print("Yes")
        exit(0)
print("No" if (n % 4 != 0) and (n % 7 != 0) else "Yes")
N,M = map(int,input().split())
n = [0]*N
n_used = [False]*N
if N > 1:
    n[0]=1
for i in range(0,M,1):
    s,c = map(int,input().split())
    if (n_used[s-1] and n[s-1]!=c) or (s==1 and c ==0 and N != 1):
        print(-1)
        exit()
    else:
        n[s-1]=c
        n_used[s-1]=True

print("{}{}{}".format(n[0],n[1],n[2]))

### FIXED CODE ###

N,M = map(int,input().split())
n = [0]*N
n_used = [False]*N
if N > 1:
    n[0]=1
for i in range(0,M,1):
    s,c = map(int,input().split())
    if (n_used[s-1] and n[s-1]!=c) or (s==1 and c ==0 and N != 1):
        print(-1)
        exit()
    else:
        n[s-1]=c
        n_used[s-1]=True
st = "".join(list(map(str,n)))
print(st)
h,w,k=map(int,input().split())
c=[[] for i in range(h)]
for i in range(h):
  S=input()
  for j in range(w):
    c[i].append(S[j])
b1=2**h
b2=2**w
cnt=0
tori=0
for i in range(b1):
  s=(str(bin(i))[2:]).zfill(h)
  for j in range(b2):
    d=[]
    d=copy.deepcopy(c)
    cnt=0
    t=(str(bin(j))[2:]).zfill(w)
    for l in range(h):
      if s[l]=='1':
        for unchi in range(w):
          d[l][unchi]='r'
    for m in range(w):
      if t[m]=='1':
        for unchi in range(h):
          d[unchi][m]='r'
    for ch in range(h):
      cnt+=d[ch].count('#')
    if cnt==k:
      tori+=1
print(tori)

      

### FIXED CODE ###

import copy
h,w,k=map(int,input().split())
c=[[] for i in range(h)]
for i in range(h):
  S=input()
  for j in range(w):
    c[i].append(S[j])
b1=2**h
b2=2**w
cnt=0
tori=0
for i in range(b1):
  s=(str(bin(i))[2:]).zfill(h)
  for j in range(b2):
    d=[]
    d=copy.deepcopy(c)
    cnt=0
    t=(str(bin(j))[2:]).zfill(w)
    for l in range(h):
      if s[l]=='1':
        for unchi in range(w):
          d[l][unchi]='r'
    for m in range(w):
      if t[m]=='1':
        for unchi in range(h):
          d[unchi][m]='r'
    for ch in range(h):
      cnt+=d[ch].count('#')
    if cnt==k:
      tori+=1
print(tori)
H, W = map(int, input().split())
S = [list(input()) for _ in range(H)]

cnt = [[0 for _ in range(W)] for _ in range(H)]
for i in range(H):
  done = [0 for _ in range(W)]
  for j in range(W):
    if S[i][j] == "#":
      continue
    if done[j]:
      continue
    l = 0
    while j + l < W:
      if S[i][j] == "#":
        break
      l += 1
    for k in range(l):
      cnt[i][j + k] += l
      done[j + k] = 1

for i in range(W):
  done = [0 for _ in range(H)]
  for j in range(H):
    if S[i][j] == "#":
      continue
    if done[i]:
      continue
    l = 0
    while i + l < H:
      if S[i][j] == "#":
        break
      l += 1
    for k in range(l):
      cnt[i + k][j] += l
      done[i + k] = 1

ans = 0
for i in range(H):
  for j in range(W):
    ans = max(ans, cnt[i][j] - 1)
print(ans)

### FIXED CODE ###

H, W = map(int, input().split())
S = [list(input()) for _ in range(H)]

cnt = [[0 for _ in range(W)] for _ in range(H)]
for i in range(H):
  done = [0 for _ in range(W)]
  for j in range(W):
    if S[i][j] == "#":
      continue
    if done[j]:
      continue
    l = 0
    while j + l < W:
      if S[i][j + l] == "#":
        break
      l += 1
    for k in range(l):
      cnt[i][j + k] += l
      done[j + k] = 1

for j in range(W):
  done = [0 for _ in range(H)]
  for i in range(H):
    if S[i][j] == "#":
      continue
    if done[i]:
      continue
    l = 0
    while i + l < H:
      if S[i + l][j] == "#":
        break
      l += 1
    for k in range(l):
      cnt[i + k][j] += l
      done[i + k] = 1

ans = 0
for i in range(H):
  for j in range(W):
    ans = max(ans, cnt[i][j] - 1)
print(ans)
import sys
n, k = map(int, input().split())
a = list(map(int, input().split()))
now, route = 1, []

while not now in route:
    route.append(now)
    now = a[now-1]
route.append(now)
route.pop(0)
num = k%len(route)

count = route.index(route[-1])
if k-1 <= count:
    print(route[k-1])
    sys.exit()
else:
    if count != len(route)-1:
        route = route[count:]
if num == 0:
    num = len(route)
print(route[num-1])


### FIXED CODE ###

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

route = []
town = set()
now = 1

while True:
    now = a[now-1]
    if now in town:
        break
    town.add(now)
    route.append(now)

count = route.index(now)
if count >= k:
    print(route[k-1])
else:
    route = route[count:]
    num = (k-count)%len(route)
    print(route[num-1])
文字列を取り込む。
文字数を数える。
文字列をソートする。
最初の文字と二番目の文字が同じかどうか確認する。
同じならば'NO'を出力する。
違うならば二番目の文字列と三番目の文字列が同じかどうか確認する。
同じならば'NO'を出力する。
・
・
・
最後から一つ前の文字と最後の文字を確認して違うならば
'YES'を出力する。

### FIXED CODE ###

a,b = map(int, input().split())
if (a+b>=10):
	print("error")
else:
	print(a+b)
a,b=[int(i) for i in input.split()]
print((a-1)*(b-1))

### FIXED CODE ###

a,b=[int(i) for i in input().split()]
print((a-1)*(b-1))
def resolve():
    n=int(input())
    a=[0]*(10001)
    nn=int(n**0.5)
    for x in range(1,nn):
        for y in range(1, nn):
            for z in range(1, nn):
                a[x**2+y**2+z**2+x*y+y*z+z*x]+=1
    for i in range(n):
        print(a[i+1])
resolve()

### FIXED CODE ###

def resolve():
    n=int(input())
    a=[0]*(60000)
    nn=int(n**0.5)
    for x in range(1,nn):
        for y in range(1, nn):
            for z in range(1, nn):
                a[x**2+y**2+z**2+x*y+y*z+z*x]+=1
    for i in range(n):
        print(a[i+1])
resolve()
import math

N  = int(raw_input())

ans = []
T, A = [0] * 1000, [0] * 1000

for i in range(N):
    T[i], A[i] = map(int, raw_input().split())

    if (i != 0) and ((T[i -1] - T[i] > 0) or (A[i - 1] - A[i] > 0)):

            if (T[i -1] / T[i]) > (A[i - 1] / A[i]):
                m  = math.ceil(T[i -1] / T[i]) 

            else:
                m = math.ceil(A[i - 1] / A[i])

            T[i] *= m
            A[i] *= m

        ans = [T[i], A[i]]

print "%d" % sum(ans)

### FIXED CODE ###

N  = int(raw_input())

ans = [0, 0]
T, A = [0] * 1001, [0] * 1001

for i in range(N):
    T[i], A[i] = map(int, raw_input().split())

    if i != 0 and T[i - 1] - T[i] > 0 or A[i - 1] - A[i] > 0:

        if (T[i  - 1] / T[i]) > (A[i - 1] / A[i]):
            m  = T[i  - 1] / T[i]
            if T[i - 1] % T[i] != 0:
                m += 1 

        else:
            m = A[i - 1] / A[i]
            if A[i - 1] % A[i] != 0:
                m += 1

        T[i] *= m
        A[i] *= m

    ans = [T[i], A[i]]

print sum(ans)
class UnionFind:
    def __init__(self, N):
        self.N = N
        self.parent = [-1] * N

    def root(self, A):
        if (self.parent[A] < 0):
            return A
        self.parent[A] = self.root(self.parent[A])
        return self.parent[A]

    def size(self, A):
        return -self.parent[self.root(A)]

    def unite(self, A, B):
        A = self.root(A)
        B = self.root(B)

        if (A == B):
            return False

        if (self.size(A) < self.size(B)):
            A, B = B, A

        self.parent[A] += self.parent[B]
        self.parent[B] = A

        return True

    def is_in_same(self, A, B):
        return self.root(A) == self.root(B)


N, M = map(int, input().split())
uf = UnionFind(N)

for i in range(M):
    a, b = map(int, input().split())
    uf.union(a, b)

print(max(uf.size(i)) for i in range(1, N+1))


### FIXED CODE ###

class UnionFind:
    def __init__(self, N):
        self.N = N
        self.parent = [-1] * N

    def root(self, A):
        if (self.parent[A] < 0):
            return A
        self.parent[A] = self.root(self.parent[A])
        return self.parent[A]

    def size(self, A):
        return -self.parent[self.root(A)]

    def unite(self, A, B):
        A = self.root(A)
        B = self.root(B)

        if (A == B):
            return False

        if (self.size(A) < self.size(B)):
            A, B = B, A

        self.parent[A] += self.parent[B]
        self.parent[B] = A

        return True

    def is_in_same(self, A, B):
        return self.root(A) == self.root(B)


N, M = map(int, input().split())
uf = UnionFind(N)

for i in range(M):
    a, b = map(int, input().split())
    uf.unite(a-1, b-1)

ans = 0
for i in range(N):
  ans = max(ans, uf.size(i))

print(ans)
from fractions import gcd

MOD = 10 ** 9 + 7

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

tmp = 1
for a in A:
    tmo *= a // gcd(tmp, a)

ans = 0
for a in A:
    ans += (tmp // a) MOD
    ans %= MOD

print (ans)
    

### FIXED CODE ###

def main():
    from fractions import gcd

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

    MOD = 10 ** 9 + 7

    tmp = 1
    for a in A:
        tmp *= a // gcd(tmp, a)

    ans = 0
    for a in A:
        ans += tmp // a
    ans %= MOD

    print (ans)

if __name__ == '__main__':
    main()
def main():
    n,k = map(int,input().split())
    dests =[0 for _ in range(n)]
    telepos = list(map(int,input().split()))
    for i,t in enumerate(telepos):
        dests[i] = t-1
    print(dfs(dests,k))




def solve(dests,k,here = 0):
    here = 0
    telepo_times = 0
    cycle_start = -1
    cycle_end = -1
    cycle_length = -1
    visited = []
    ids = dict()


    #循環検出！同じ町にいつ戻ってくるのか
    while telepo_times < k:
        #print("現在地は",here)
        if here in visited:
            cycle_start = ids[here]
            #print(cycle_start,"でループが始まった")
            cycle_end = telepo_times - 1
            #print(cycle_end,"でループが終わった")
            cycle_length = cycle_end - cycle_start + 1
            #print("サイクルの長さは",cycle_length,"だ")
            break
        ids[here] = telepo_times

        visited.append(here)
        telepo_times += 1
        here = dests[here]
    if cycle_length == -1:
        return here + 1

    cycle_index = (k-cycle_start) % cycle_length
    return visited[cycle_start + cycle_index] + 1




    #telepo_times = 0
    #while telepo_times < (k - cycle_start)%cycle_length:
    #    telepo_times += 1
    #    here = dests[here]







if __name__ == '__main__':
    main()


### FIXED CODE ###


def main():
    n,k = map(int,input().split())
    dests =[0 for _ in range(n)]
    telepos = list(map(int,input().split()))
    for i,t in enumerate(telepos):
        dests[i] = t-1
    print(solve(dests,k))




def solve(dests,k,here = 0):
    here = 0
    telepo_times = 0
    cycle_start = -1
    cycle_end = -1
    cycle_length = -1
    visited = dict()
    visited2 = []


    #循環検出！同じ町にいつ戻ってくるのか
    while telepo_times < k:
        #print("現在地は",here)
        if here in visited:
            cycle_start = visited[here]
            #print(cycle_start,"でループが始まった")
            cycle_end = telepo_times - 1
            #print(cycle_end,"でループが終わった")
            cycle_length = cycle_end - cycle_start + 1
            #print("サイクルの長さは",cycle_length,"だ")
            break
        #ids[here] = telepo_times

        visited[here] = telepo_times
        visited2.append(here)
        telepo_times += 1
        here = dests[here]
    if cycle_length == -1:
        return here + 1

    cycle_index = (k-cycle_start) % cycle_length
    return visited2[cycle_start + cycle_index] + 1




    #telepo_times = 0
    #while telepo_times < (k - cycle_start)%cycle_length:
    #    telepo_times += 1
    #    here = dests[here]







if __name__ == '__main__':
    main()
#!/usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    x = II()
    if x < 1200:
        print("ABC")
    else:
        print("ARC")
    return

#B
def B():
    s = S()
    a = inf
    z = 0
    for num,si in enumerate(s):
        if si == "a":
            a = min(a, num)
        if si == "z":
            z = max(z, si)
    print(z-a+1)
    return

#C
def C():
    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == '__main__':
    A()


### FIXED CODE ###

#!/usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    x = II()
    if x < 1200:
        print("ABC")
    else:
        print("ARC")
    return

#B
def B():
    s = S()
    a = inf
    z = 0
    for num,si in enumerate(s):
        if si == "A":
            a = min(a, num)
        if si == "Z":
            z = max(z, num)
    print(z-a+1)
    return

#C
def C():
    return

#D
def D():
    return

#Solve
if __name__ == '__main__':
    B()
#082_D
s = input()
x, y = map(int, input().split())
xgo, ygo = [], []

flg = True
cnt = 0
for i in range(len(s)):
    if s[i] == 'T':
        if flg and cnt > 0:
            xgo.append(cnt)
        elif cnt > 0:
            ygo.append(cnt)
        flg = (flg + 1) % 2
        cnt = 0
    else:
        cnt += 1
        
if flg and cnt > 0:
    xgo.append(cnt)
elif cnt > 0:
    ygo.append(cnt)
    
def search(L, x, flg):
    s = sum(L)
    dp = [[False for _ in range(s*2+1)] for _ in range(len(L)+1)]
    dp[0][s + 1] = True
    
    for i in range(1, len(L)+1):
        for j in range(-s, s+1):
            k = j + s
            if dp[i-1][k-L[i-1]]:
                dp[i][k] = True
            if flg and dp[i-1][k+L[i-1]]:
                dp[i][k] = True

    return dp[len(L)][s+x]

print('Yes' if search(xgo, x) and search(ygo, y) else 'No')

### FIXED CODE ###

#082_D
s = input()
x, y = map(int, input().split())
xgo, ygo = [], []

cnt = 0
flg = True
check = True if s[0] == 'F' else False
for i in range(len(s)):
    if s[i] == 'T':
        if flg and cnt > 0:
            xgo.append(cnt)
        elif cnt > 0:
            ygo.append(cnt)
        cnt = 0
        flg = (flg + 1) % 2
    else:
        cnt += 1

if flg and cnt > 0:
    xgo.append(cnt)
elif cnt > 0:
    ygo.append(cnt)

flg1, flg2 = len(xgo)==0, len(ygo)==0

sum_x, sum_y = sum(xgo), sum(ygo)
dp1 = [[False for _ in range(2*sum_x+1)] for _ in range(len(xgo)+1)]
dp2 = [[False for _ in range(2*sum_y+1)] for _ in range(len(ygo)+1)]

if check:
    dp1[1][sum_x+xgo[0]] = True
    for i in range(2, len(xgo)+1):
        for j in range(-sum_x, sum_x+1):
            if 0 <= j+sum_x-xgo[i-1] <= 2*sum_x:
                if dp1[i-1][j+sum_x-xgo[i-1]]:
                    dp1[i][j+sum_x] = True
            if 0 <= j+sum_x+xgo[i-1] <= 2*sum_x:
                if dp1[i-1][j+sum_x+xgo[i-1]]:
                    dp1[i][j+sum_x] = True
else:
    dp1[0][sum_x] = True
    for i in range(1, len(xgo)+1):
        for j in range(-sum_x, sum_x+1):
            if 0 <= j+sum_x-xgo[i-1] <= 2*sum_x:
                if dp1[i-1][j+sum_x-xgo[i-1]]:
                    dp1[i][j+sum_x] = True
            if 0 <= j+sum_x+xgo[i-1] <= 2*sum_x:
                if dp1[i-1][j+sum_x+xgo[i-1]]:
                    dp1[i][j+sum_x] = True

dp2[0][sum_y] = True
for i in range(1, len(ygo)+1):
    for j in range(-sum_y, sum_y+1):
        if 0 <= j+sum_y-ygo[i-1] <= 2*sum_y:
            if dp2[i-1][j+sum_y-ygo[i-1]]:
                dp2[i][j+sum_y] = True
        if 0 <= j+sum_y+ygo[i-1] <= 2*sum_y:
            if dp2[i-1][j+sum_y+ygo[i-1]]:
                dp2[i][j+sum_y] = True
                
if flg1:
    flgx = (x == 0)
elif abs(x) > sum_x:
    flgx = False
else:
    flgx = dp1[len(xgo)][sum_x+x]
    
if flg2:
    flgy = (y == 0)
elif abs(y) >sum_y:
    flgy = False
else:
    flgy = dp2[len(ygo)][sum_y+y]
    
print('Yes' if flgx and flgy else 'No')
N = int(input())
li = []
for i in range(N):
    a = list(map(int,input().split()))
    li.append(a)
cross = []

##計算量に余裕があるので全探索します
for i in range(N):
    for j in range (i+1, N):
        a = [li[j][0]-li[i][0],li[j][1]-li[i][1]]
        cross.append(a) 

lencross = len(cross)

res = 0
ans = []

for i in range (lencross):
    res = 0
    for j in range (lencross):
        if cross[i] == cross[j]:
            res += 1
    ans.append(res)
maxa = max(ans)
print(cross)  
print(N - maxa)   

### FIXED CODE ###

import sys
N = int(input())
li = []
if N == 1 or N == 2:
    a = list(map(int,input().split()))
    print(1)
    sys.exit()   

for i in range(N):
    a = list(map(int,input().split()))
    li.append(a)

cross = []

##計算量に余裕があるので全探索します
for i in range(N):
    for j in range (i+1, N):
        a = [li[j][0]-li[i][0],li[j][1]-li[i][1]]
        if a[0] <= 0 and a[1] <= 0:
            b = [abs(li[j][0]-li[i][0]),abs(li[j][1]-li[i][1])]
            cross.append(b)
        elif a[0] < 0 and a[1] >= 0:
            c = li[j][1]-li[i][1]
            b = [abs(li[j][0]-li[i][0]),-c]
            cross.append(b) ####
        else:
            cross.append(a) 
lencross = len(cross)

res = 0
ans = []

for i in range (lencross):
    res = 0
    for j in range (lencross):
        if cross[i] == cross[j]:
            res += 1
    ans.append(res)
reduce = max(ans)

print(N - reduce)
N, M = map(int, input().split())
e = [[] for _ in range(N)]
for i in range(M):
    A, B = map(int, input().split())
    A -= 1
    B -= 1
    e[A].append(B)
    e[B].append(A)
# print(e)

def dfs(n, k):
    seen[n] = k
    # print(seen)
    for i in e[n]:
        if seen[i] != -1: continue
        dfs(i, k)
    return

seen = [-1] * N
k = -1
for i in range(N):
    if seen[i] == -1:
        k += 1
        dfs(i, k)
# print(seen)
print(k)

### FIXED CODE ###

import queue

N, M = map(int, input().split())
e = [[] for _ in range(N)]
for i in range(M):
    A, B = map(int, input().split())
    A -= 1
    B -= 1
    e[A].append(B)
    e[B].append(A)
# print(e)

seen = [-1] * N
k = -1
for i in range(N):
    if seen[i] == -1:
        k += 1
        seen[i] = k
        que = queue.Queue()
        que.put(i)
        while not que.empty():
            v = que.get()
            for nv in e[v]:
                if seen[nv] != -1: continue
                seen[nv] = k
                que.put(nv)
# print(seen)
print(k)
import numpy as np
n = int(input())
an = np.array(input().split(" ")).astype("int64")
if an[0] == 0:
    if n % 2 == 0:
        print("0")
    elif n % 2 == 1:
        print("1")
        print("1")
elif an[0] == 1:
    if n % 2 == 0:
        print("1")
        print("1")
    elif n % 2 == 1:
        print("0")

### FIXED CODE ###

r = int(input())
print(3 * (r ** 2))
n = int(input())
 
m = {}
 
for i in range(n):
  x = int(input())
  m.add(x)
  
print(len(m))

### FIXED CODE ###

n = int(input())
 
m = set()
 
for i in range(n):
  x = int(input())
  m.add(x)
  
print(len(m))
N = input()
A = list(map(int,input().split()))
Sum = 0

for i in range(N-1):
  if(A[i] - A[i+1] > 0):
    Sum += A[i] - A[i+1]
    A[i+1] += A[i] - A[i+1]
 
print(Sum)

### FIXED CODE ###

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

for i in range(N-1):
  if(A[i] - A[i+1] > 0):
    Sum += A[i] - A[i+1]
    A[i+1] += A[i] - A[i+1]
 
print(Sum)
input_line = list(map(int,input().split()))
tree_info = []
for i in range(input_line[0]-1):
    info = list(input().split())
    tree_info.append(info)
counter = [0] * input_line[0]
for i in range(input_line[1]):
    count_info = list(map(int, input().split()))
    counter[count_info[0]-1] += count_info[1]
for i in range(1,len(counter)):
    counter[i] += counter[int(tree_info[i-1][0])-1]
print(" ".join(list(map(str,counter))))
    

### FIXED CODE ###

input_number = int(input())
input_string = input()
if input_number < 3200:
    print("red")
else:
    print(input_string)
import itertools

N, C = map(int, input().split())
d = [list(map(int, input().split())) for _ in range(C)]
c = [list(map(int, input().split())) for _ in range(N)]

memo = [[0 for i in range(C)]for j in range(3)]

for i in range(N):
    for j in range(N):
        cij = c[i][j]
        a = (i + j + 2) % 3
        for k in range(C):
            memo[a][k] += d[cij-1][k]

ans = 25000000


for c1, c2, c3 in itertools.permutations(range(C), 3):
    ans = min(ans, memo[c1][0] + memo[c2][1] + memo[c3][2])

print(ans)


### FIXED CODE ###

import itertools

N, C = map(int, input().split())
d = [list(map(int, input().split())) for _ in range(C)]
c = [list(map(int, input().split())) for _ in range(N)]

memo = [[0 for i in range(C)]for j in range(3)]

for i in range(N):
    for j in range(N):
        cij = c[i][j]
        a = (i + j + 2) % 3
        for k in range(C):
            memo[a][k] += d[cij-1][k]

ans = float('inf')

for c1, c2, c3 in itertools.permutations(range(C), 3):
    ans = min(ans, memo[0][c1] + memo[1][c2] + memo[2][c3])

print(ans)