Harryxun/stf_run huggingface dataset:
import sys
sys.setrecursionlimit(5000)
N,M = map(int,input().split())
def stair(N):
    if(N <0):
        return 0
    if(N == 0):
        return 1
    elif(N == 1):
        return 1
    elif(N == 2):
        return 2
    else:
        return stair(N-1)+stair(N-2)
ans = 1
a = 0
mod = 10**9+7
for i in range(M):
    b = int(input())
    b -=1
    ans = ans*stair(b-a)%mod
    a = b+2
ans = ans*stair(N-a)%mod
print(ans)

### FIXED CODE ###

N,M = map(int,input().split())
steps = [1,1,2]
for i in range(3,N+1):
    steps.append(steps[i-1]+steps[i-2])
ans = 1
a = 0
mod = 10**9+7
for i in range(M):
    b = int(input())
    b -=1
    if(b<a):
        print(0)
        exit()
    else:
        ans = ans*steps[b-a]%mod
    a = b+2
ans = ans*steps[N-a]%mod
print(ans)
def popcount(n):
    ret=0
    while n!=0:
        if n%2==1:
            ret+=1
        n//=2
    return ret

def f(n):
    ret=0
    original=n
    while True:
        n=n%popcount(n)
        if n in memo:
            memo[original]=ret+memo[n]
            return memo[original]
        if n!=0:
            ret+=1
        else:
            ret+=1
            break
    memo[original]=ret
    return ret

N=int(input())
X=input()
bit=[""]*N
for i in range(N):
    bit[i]=X[i]

n=int(X,2)
memo={}
for i in range(N):
    tmp=n
    if bit[i]=="0":
        tmp+=2**(N-i-1)
    else:
        tmp-=2**(N-i-1)
    print(f(tmp))

### FIXED CODE ###

def popcount_int(n):
    return bin(n).count('1')

def popcount_bin(s):
    return s.count('1')

def poptimes(n,cnt=1):
    if n==0:
        return cnt
    else:
        n%=popcount_int(n)
        cnt+=1
        return poptimes(n,cnt)

N=int(input())
S=input()

S_int=int(S,2)
pc=popcount_bin(S)
pc_plus=S_int%(pc+1)
if pc!=1:
    pc_minus=S_int%(pc-1)

for i in range(N):
    if S[i]=='1':
        if pc!=1:
            tmp=pc_minus-pow(2,N-i-1,pc-1)
            print(poptimes(tmp%(pc-1)))
        else:
            print(0)
            continue
    else:
        tmp=pc_plus+pow(2,N-i-1,pc+1)
        print(poptimes(tmp%(pc+1)))
import sys
sys.setrecursionlimit(10 ** 5 + 10)


def input(): return sys.stdin.readline().strip()


def resolve():

    N = int(input())
    num = [i for i in range(1, N+1)]
    A = list(map(int, input().split()))
    d=defaultdict(int)
    cnt=0
    for k,v in enumerate(A):
        d[k+v]+=1
        cnt+=d[k-v]

    print(cnt)


resolve()

### FIXED CODE ###

#!/usr/bin/python3
# import bisect
from collections import Counter, deque, OrderedDict,defaultdict
# from copy import copy, deepcopy
# from functools import reduce
# from heapq import heapify, heappop, heappush
# from itertools import accumulate, permutations, combinations, combinations_with_replacement, groupby, product
# import math
# import numpy as np  # Pythonのみ！
# from operator import xor
# import re
# from scipy.sparse.csgraph import connected_components  # Pythonのみ！
# ↑cf.  https://note.nkmk.me/python-scipy-connected-components/
# from scipy.sparse import csr_matrix
# import statistics # Pythonのみ
# import string
import unittest
from io import StringIO
import sys
sys.setrecursionlimit(10 ** 5 + 10)


def input(): return sys.stdin.readline().strip()


def resolve():

    N = int(input())
    A = list(map(int, input().split()))
    d=defaultdict(int)
    cnt=0
    for k,v in enumerate(A):
        d[k+v]+=1
        cnt+=d[k-v]

    print(cnt)


resolve()
s = [int(i) for i in input().split()]
s = swapcase(1200)
print(s)

### FIXED CODE ###

s = input()
print(s.swapcase())
from collections import defaultdict as dd
N, Q = map(int, input().split())
parents = {}
for _ in range(N-1):
    a, b = map(int, input().split())
    parents[b] = a
process = dd(int)
for _ in range(Q):
    p, x = map(int, input().split())
    process[p] += x
points = [0]*(N+1)
for i in range(1, N+1):
    points[i] += process[i]
    if i != 1:
        points[i] += points[parents[i]]
print(' '.join(map(str, points[1:])))

### FIXED CODE ###

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

n, q = map(int, input().split())
g = [list() for i in range(n)]
node = [0] * n

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

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

def dfs(v, p=-1):
    for u in g[v]:
        if u == p: continue
        node[u] += node[v]
        dfs(u, v)

dfs(0)
print(*node)
S = input()
Q = int(input())
for _ in range(Q):
  T = input()
  
  if len(T)==1:
    S = S[::-1]
  else:
	if T[3]=="1":
      S = T[5]+S
    else:
      S = S+T[5]
print(S)
	
      
    


### FIXED CODE ###

from collections import deque

S = input()
Q = int(input())

t = deque(S)
reverse = False
for _ in range(Q):
    query = input()
    if query[0] == '1':
        reverse = not reverse
    elif query[0] == '2':
        _, F, C = query.split()
        if F == '1':
            if reverse:
                t.append(C)
            else:
                t.appendleft(C)
        elif F == '2':
            if reverse:
                t.appendleft(C)
            else:
                t.append(C)
result = ''.join(t)
if reverse:
    result = result[::-1]
print(result)
n = int(input())
A = list(map(int,input().split))
c = 0
while all(a%2==0 for a in A):
	A = [a//2 for a in A]
    c += 1
print(c)

### FIXED CODE ###

n=int(input())
A=list(map(int,input().split()))
c=0
while(all(a%2==0 for a in A)):
    A = [a//2 for a in A]
    c+=1
print(c)
N,T=map(int,input().split())
lists=[list(map(int,input().split())) for x in range(N)]
ans=[]
for list in lists:
  if list[1]<=T:
    ans.append(list)
ans.sort(key=lambda x:x[0])
print(ans[0][0])

### FIXED CODE ###

N,T=map(int,input().split())
lists=[list(map(int,input().split())) for x in range(N)]
ans=[]
for list in lists:
  if list[1]<=T:
    ans.append(list)
if len(ans)==0:
  print('TLE')
else:
  ans.sort(key=lambda x:x[0])
  print(ans[0][0])
S=list(input())
N=len(S)
S1=S[:(N-1)//2]
S2=S[(N+1)//2:]
if S==S[:-1] and S1=S1[:-1] and S2==S2[:-1]:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

S=input()
N=len(S)
S1=S[:(N-1)//2]
S2=S[(N+1)//2:]
if S==S[::-1] and S1==S1[::-1] and S2==S2[::-1]:
  print("Yes")
else:
  print("No")
cook = []
for i in range(5):
    cook.append(int(input()))
mn = 10
time = 0
for i in cook:
    if i%10 < mn and i%10!=0:
        mn = i%10
for i in cook:
    if (i%10)==mn:
        ans = i
        continue
    else:
        if i%10==0:
            time += i
        else:
            time += i + 10-(i%10)
    print(time)
time += ans
print(time)

### FIXED CODE ###

s = 0
rests = [None]*5

for i in range(5):
    t_num = int(input())
    s += t_num
    rests[i] = (10 - (t_num % 10)) % 10 

print(s + sum(rests)- max(rests))
n = int(input())
h = list(map(int,input().split()))
count = h[0]
for i in range(n-1):
    if h[i+1]>h[i]:
        count += h[i+1]-h[i]
print(cnt)


### FIXED CODE ###

N = int(input())
h = list(map(int,input().split()))
cnt = h[0]
for i in range(N-1):
  if h[i+1]>h[i]:
    cnt += h[i+1]-h[i]
print(cnt)
import numpy as np

n,m = map(int,input().split())
a_list = []
c = []

for i in range(m):
    a,b = map(int,input().split())
    a_list.append(a)
    c.append(sum(1 << j-1 for j in list(map(int,input().split()))))

inf = 10**10
dp = [inf]*(1 << n)
dp[0] = 0

for i in range(1 << n):
    for j in range(m):
        dp[c[j]|i] = min(dp[c[j]|i],dp[i]+a_list[j])

if dp[-1] == inf:
    print(-1)
else:
    print(dp[-1])

### FIXED CODE ###

n,m = map(int,input().split())
a_list = []
c = []

for i in range(m):
    a,b = map(int,input().split())
    a_list.append(a)
    c.append(sum(1 << j-1 for j in list(map(int,input().split()))))

inf = 10**10
dp = [inf]*(1 << n)
dp[0] = 0

for i in range(1 << n):
    for j in range(m):
        dp[c[j]|i] = min(dp[c[j]|i],dp[i]+a_list[j])

if dp[-1] == inf:
    print(-1)
else:
    print(dp[-1])
n, m = map(int, input().split())
a = [0] * m
for i in range(m):
    a[i] = int(input())

ans = n - sum(a)
if ans > 0:
    print(ans)
else:
    print(-1)


### FIXED CODE ###

# ABC163B

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

ans = n - sum(a)
if ans >= 0:
    print(ans)
else:
    print(-1)
S = list(input())
acgt = ['A', 'C', 'G', 'T']

wlist=[]
answer=[]
for word in S:
    if word in acgt:
        wlist.append(word)
    else:
        print(wlist)
        answer.append(len(wlist))
        wlist=[]

print(max(answer))

### FIXED CODE ###

S = list(input())
acgt = ['A', 'C', 'G', 'T']

c=0
ans=0
for word in S:
    c = c+1 if word in acgt else 0
    ans = max(ans, c)
print(ans)
# -*- coding: utf-8 -*-
N = str(input())
a=[]
for i in range(N):
  S = int(N[i])
  a.append(S)
T = sum(a)
if int(N) % T == 0:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

# -*- coding: utf-8 -*-
N = str(input())
a=[]
for i in range(len(N)):
  S = int(N[i])
  a.append(S)
T = sum(a)
if int(N) % T == 0:
  print("Yes")
else:
  print("No")
x = int(input())

def fun(x):

    res = []

    for a in range(-100, 100):
        for b in range(-100, 100):
            mult = a**5 - b**5
            if mult == x:
                res = a, b
                break
    print(res[0], res[1])

fun(x)

### FIXED CODE ###

x = int(input())

def fun(x):

    res = []

    for a in range(-1000, 1000):
        for b in range(-1000, 1000):
            mult = a**5 - b**5
            if mult == x:
                res = a, b
                break
    print(res[0], res[1])

fun(x)
a = input()
b = input()
c = input()
d = input()

ab = a - b
bc = b - c
ac = a - c

if a <= b <= c <= or  c < b < a
  if ab <= d and bc <= d or ac <= d:
      print("Yes")
  else:
      print("No")
else:
  if ac <= d
    print("Yes")
  else:
    print("No")

### FIXED CODE ###

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

if abs(a-b) <= d and abs(b-c) <= d or abs(a-c) <= d:
    print('Yes')
else:
    print('No')
X = int(input())
a = 1
for i in range(1,X):
    for j in range(2,X):
        if i**j <= X:
            a = max(a,i**j)
        else:
            break

print(a)


### FIXED CODE ###

a,b,c,d = map(int,input().split())
print('Yes' if abs(b-a) <= d and abs(c-b) <= d or abs(c-a) <= d else 'No')
import numpy as np
N = int(input())

ARR = []

for i in range(N):
    ARR.append([int(s) for s in input().split(" ")])

PRR = []

for i in range(N):
    PRR.append([int(s) for s in input().split(" ")])

def calculate(n, arr, prr):
    arr = np.array(arr)

    brr = []
    for i in range(1,2 ** 10):

        mask = np.zeros(10)
        for j in range(0, 10):
            m = i >> j & 1
            mask[9-j] = m
        s = np.count_nonzero((arr == mask) & (arr == 1),axis=1)

        sum = 0
        for _i in range(n):
            sum = sum + prr[_i][s[_i]]

        brr.append(sum)


    return [1]

result = calculate(N, ARR, PRR)
print(max(result))




### FIXED CODE ###

n = int(input())

frr = []

for i in range(n):
    frr.append([int(s) for s in input().split(" ")])

prr = []

for i in range(n):
    prr.append([int(s) for s in input().split(" ")])

# n = 2
#
# frr = [
#     [1, 1, 1, 1, 1, 0, 0, 0, 0, 0],
#     [0, 0, 0, 0, 0, 1, 1, 1, 1, 1]
# ]
#
# prr = [
#     [0, -2, -2, -2, -2, -2, -1, -1, -1, -1, -1],
#     [0, -2, -2, -2, -2, -2, -1, -1, -1, -1, -1]
# ]


res = []
for i in range(1,2 ** 10):
    count = [0 for s in range(n)]

    mask = []
    for j in range(10):
        m =  i >> j & 1
        mask.append(m)
        if m == 1:
            for k in range(n):
                if frr[k][j] == 1:
                    count[k] = count[k] + 1

    mm = []
    for index,c in enumerate(count):
        mm.append(prr[index][c])

    res.append(sum(mm))

print(max(res))
n = int( raw_input() )
   
d = [ 0 for i in range(n) ]
f = [ 0 for i in range(n) ]
G = [ 0 for i in range(n) ]
v = [ [0 for i in range(n) ] for j in range(n) ]
st = [ 0 for i in range(n) ]
tm = [ 0 ]
   
def DFS_visit(s):
  st[ s ] = 1
  tm[ 0 ] += 1
  d[ s ] = tm[ 0 ]
  for e in range(n):
    if v[ s ][ e ] == 1 and st[ e ] == 0:
      DFS_visit(e)
  st[ s ] == 2
  tm[ 0 ] += 1
  f[ s ] = tm[ 0 ]
   
def DFS():
  for s in range(n):
    if st[ s ] == 0:
      DFS_visit(s)
  for s in range(n):
     print'{ 0 } { 1 } { 2 }'.format( s+1 , d[ s ] , f[ s ] )
       
for i in range(n):
  G = map( int , raw_input().split() )
  for j in range( G[ 1 ] ):
    v[ G[ 0 ] - 1 ][G [ 2+j ] - 1 ] = 1
   
DFS()

### FIXED CODE ###

n = int( raw_input() )
   
d = [ 0 for i in range(n) ]
f = [ 0 for i in range(n) ]
G = [ 0 for i in range(n) ]
v = [ [0 for i in range(n) ] for j in range(n) ]
st = [ 0 for i in range(n) ]
tm = [ 0 ]
   
def DFS_visit(s):
  st[ s ] = 1
  tm[ 0 ] += 1
  d[ s ] = tm[ 0 ]
  for e in range(n):
    if v[ s ][ e ] == 1 and st[ e ] == 0:
      DFS_visit(e)
  st[ s ] == 2
  tm[ 0 ] += 1
  f[ s ] = tm[ 0 ]
   
def DFS():
  for s in range(n):
    if st[ s ] == 0:
      DFS_visit(s)
  for s in range(n):
     print'{0} {1} {2}'.format( s+1 , d[ s ] , f[ s ] )
       
for i in range(n):
  G = map( int , raw_input().split() )
  for j in range( G[1] ):
    v[ G[0] -1 ][ G[ 2+j ] -1 ] = 1
   
DFS()
c = input()
S = 'abcdefghijklmnopqrstuvwxy'
f = S.find(c)
print (S[f+1])

### FIXED CODE ###

c = input()
S = 'abcdefghijklmnopqrstuvwxyz'
f = S.find(c)
print (S[f+1])
s = input()
for i in range(len(s)):
  s[i] = "x"
print(s)

### FIXED CODE ###

s = input()
a = ""
for i in range(len(s)):
  a += "x"
print(a)
h,w,m = map(int, input().split())

lh = []
lw = []

for i in range(m):
  h1,w1 = map(int, input().split())
  lh.append(h1)
  lw.append(w1)

from collections import Counter as co
c=co(lh).most_common()

ans1 = c[0][1]
ans2 = 0
i = 0
while c[i][1] == c[0][1]:
  tmp = c[i][0]
  lh_c = [j for j, x in enumerate(lh) if x == tmp]
  tmp_lw = lw[:]
  for k in sorted(lh_c, reverse=True):
    tmp_lw.pop(k)
  cw = co(tmp_lw).most_common()
  ans2 = max(ans2, cw[0][1])
  i += 1
  if i >= len(c)-1:
    break
  
print(ans1+ans2)

### FIXED CODE ###

h,w,m = map(int, input().split())

lh = []
lw = []

for i in range(m):
  h1,w1 = map(int, input().split())
  lh.append(h1)
  lw.append(w1)

if h == 1 or w == 1:
  print(m)
else:
  from collections import Counter as co
  ch=co(lh).most_common()
  cw=co(lw).most_common()
  
  ans = 0
  tmp = ch[0][0]
  lh_c = [i for i, x in enumerate(lh) if x == tmp]
  lw_tmp = lw[:]
  for j in sorted(lh_c, reverse=True):
    lw_tmp.pop(j)
  if len(lw_tmp) == 0:
    print(ch[0][1])
  else:
    cw_tmp = co(lw_tmp).most_common()
    ans = ch[0][1]+cw_tmp[0][1]
    
    tmp = cw[0][0]
    lw_c = [i for i, x in enumerate(lw) if x == tmp]
    lh_tmp = lh[:]
    for j in sorted(lw_c, reverse=True):
      lh_tmp.pop(j)
    if len(lh_tmp) == 0:
      print(cw[0][1])
    else:
      ch_tmp = co(lh_tmp).most_common()
      ans = max(ans, cw[0][1]+ch_tmp[0][1])
      print(ans)
N = int(input())
for a in range(1,3501):
    for b in range(1,3501):
        m =  (4*a*b) - N*(a+b)
        if m>= 0 & N*a*b % m == 0:
            c = (N*a*b)//m
            break
    else:
        continue
    break
print(a,b,c)


### FIXED CODE ###

N = int(input())
for a in range(1,3501):
    for b in range(1,3501):
        m =  (4*a*b) - N*(a+b)
        if m> 0 and N*a*b % m == 0:
            c = (N*a*b)//m
            break
    else:
        continue
    break
print(a,b,c)
N,M,K=map(int,input().split())
A=list(map(int,input().split()))
B=list(map(int,input().split()))

i,j=0,0
time=0
cnt=0

while time<K and (i<N or j<M):
    if i==N:
        if time+B[j]>K:
            break
        time+=B[j]
        cnt+=1
        j+=1
    elif j==N:
        if time+A[i]>K:
            break
        time+=A[i]
        cnt+=1
        i+=1
    elif A[i]<B[j]:
        if time+A[i]>K:
            break
        time+=A[i]
        cnt+=1
        i+=1
    elif B[j]<A[i]:
        if time+B[j]>K:
            break
        time+=B[j]
        cnt+=1
        j+=1
    else:
        if time+A[i]>K:
            break
        if j==M-1 and i==N-1:
            time+=A[i]
            cnt+=1
            i+=1
        elif j==M-1:
            time+=A[i]
            cnt+=1
            i+=1
        elif i==N-1:
            time+=B[j]
            cnt+=1
            j+=1
        else:
            if A[i+1]<B[j+1]:
                time+=A[i]
                cnt+=1
                i+=1
            elif A[i+1]>B[j+1]:
                time+=B[j]
                cnt+=1
                j+=1
            else:
                time+=A[i]
                cnt+=1
                i+=1
print(cnt)

### FIXED CODE ###

from bisect import bisect_left
N,M,K=map(int,input().split())
A=list(map(int,input().split()))
B=list(map(int,input().split()))

cumA=[0]*(N+1)
cumB=[0]*(M+1)

for i in range(N):
    cumA[i+1]=cumA[i]+A[i]
for i in range(M):
    cumB[i+1]=cumB[i]+B[i]

ans=0
for i in range(N+1):
    r=K-cumA[i]
    if r<0:
        break
    b=bisect_left(cumB,r)
    if b==M+1:
        ans=max(ans,i+M)
    else:
        if cumB[b]!=r:
            b-=1
        ans=max(ans,i+b)
print(ans)
a, b, c, d, e, k = map(int, input().split())
f = e-a
if f > k:
    print(':(')
else:
    print('Yay!')

### FIXED CODE ###

a = [int(input()) for i in range(6)] 
f = a[4] - a[0]
if f > a[5]:
    print(':(')
else:
    print('Yay!')
N,M = map(int,input().split())
graph = {i:[] for i in range(N)}
for _ in range(M):
    x,y = map(int,input().split())
    x -= 1
    y -= 1
    graph[x].append(y)
    graph[y].append(x)

color = [0 for _ in range(N)]

def f(v,c):
    color[v] = c
    for j in range(len(graph[v])):
        if color[ graph[v][j] ] == c: # 隣接している頂点が同色の場合 二部グラフではない
            return False
        elif (color[graph[v][j]] ==0 and not f(graph[v][j],-c)):
            return False
    return True 

bipartite = True
for i in range(N):
    if color[i] == 0:
        if not f(i,1):
            bipartite = False

if bipartite: # 二部グラフ
    ans = color.count(1)*color.count(-1) - M
else:
    ans = M*(M-1)/2 - M

print(int(ans))

### FIXED CODE ###

import sys
sys.setrecursionlimit(100000000)

N,M = map(int,input().split())
graph = {i:[] for i in range(N)}
for _ in range(M):
    x,y = map(int,input().split())
    x -= 1
    y -= 1
    graph[x].append(y)
    graph[y].append(x)


def f(u,c):
    color[u] = c
    for v in graph[u]:
        if color[v] == 0: # まだ塗られていない場合
            if not f(v,-c):
                return False
        else:
            if color[v] == c: # 隣接している頂点が同色の場合 二部グラフではない
                return False
    return True 

flag = True
color = [0 for _ in range(N)]
for i in range(N):
    if color[i] == 0:
        if not f(i,1):
            flag = False
            break

if flag: # 二部グラフ
    ans = color.count(1)*color.count(-1) - M
else:
    ans = N*(N-1)//2 - M

print(int(ans))
import sys
def main(a,b,c):
  return (a*b)/2

if __name__=="__main__":
  main(sys.argv[1],sys.argv[2],sys.argv[3])

### FIXED CODE ###

print (lambda x:(x[0]*x[1])/2)(map(int,raw_input().split(" ")))
k = int(input())
s = input()
mod = 10 ** 9 + 7

MAX = 2 * 10 ** 6

fact = [1] * (MAX + 1)
for i in range(1, MAX + 1):
    fact[i] = (fact[i-1] * i) % mod

inv = [1] * (MAX + 1)
for i in range(2, MAX + 1):
    inv[i] = inv[mod % i] * (mod - mod // i) % mod

fact_inv = [1] * (MAX + 1)
for i in range(1, MAX + 1):
    fact_inv[i] = fact_inv[i-1] * inv[i] % mod


def comb(n, k):
    if n < k:
        return 0
    return fact[n] * fact_inv[n-k] * fact_inv[k] % mod


ln = len(s)

ans = 0
pow25 = 1
pow26 = pow(26, k, mod)
inv26 = pow(26, mod - 2, mod)
for i in range(ln, k + ln + 1):
    raise Exception
    ans += pow25 * pow26 % mod * comb(i - 1, ln - 1) % mod
    ans %= mod
    pow25 *= 25
    pow25 %= mod
    pow26 *= inv26
    pow26 %= mod

print(ans)


### FIXED CODE ###

k = int(input())
s = input()
mod = 10 ** 9 + 7

MAX = 2 * 10 ** 6

fact = [1] * (MAX + 1)
for i in range(1, MAX + 1):
    fact[i] = (fact[i-1] * i) % mod

inv = [1] * (MAX + 1)
for i in range(2, MAX + 1):
    inv[i] = inv[mod % i] * (mod - mod // i) % mod

fact_inv = [1] * (MAX + 1)
for i in range(1, MAX + 1):
    fact_inv[i] = fact_inv[i-1] * inv[i] % mod


def comb(n, k):
    if n < k:
        return 0
    return fact[n] * fact_inv[n-k] * fact_inv[k] % mod


ln = len(s)

ans = 0
pow25 = 1
pow26 = pow(26, k, mod)
inv26 = pow(26, mod - 2, mod)
for i in range(ln, k + ln + 1):
    ans += pow25 * pow26 % mod * comb(i - 1, ln - 1) % mod
    ans %= mod
    pow25 *= 25
    pow25 %= mod
    pow26 *= inv26
    pow26 %= mod

print(ans)
# -*- coding: utf-8 -*-
import math
from functools import reduce
if __name__ == '__main__':
    n = int(input())
    a = []
    ans = 0
    for i in range(n):
        tmp = int(input())
        a.append(tmp)
        if tmp == 0:
            ans += math.floor(reduce(lambda x, y: x + y, a) // 2)
            a.clear()
    ans += math.floor(reduce(lambda x, y: x + y, a) // 2)
    print(ans)


### FIXED CODE ###

# -*- coding: utf-8 -*-
import math
from functools import reduce
from operator import add
if __name__ == '__main__':
    n = int(input())
    a = [0]
    ans = 0
    for i in range(n):
        tmp = int(input())
        a.append(tmp)
        if tmp == 0:
            ans += math.floor(reduce(add, a) // 2)
            a.clear()
            a.append(0)
    ans += math.floor(reduce(add, a) // 2)
    print(ans)
a = input()
x = input()
b = input()
x_list = list(x)
print(a + x_list[0] + b)



### FIXED CODE ###

a = input()
list = a.split()
a_list = list[0]
x_list = list[1]
b_list = list[2]
print(a_list[0] + x_list[0] + b_list[0])
from math import sqrt
EPS = 10**(-8)
N = 100
def intersection(p, q, s, t):
    a = 2*(p-s)
    b = 2*(q-t)
    c = (p**2+q**2) - (s**2+t**2)
    A = a**2 + b**2
    Bx = p*b**2 + a*(c-q*b)
    Cx = (p**2+q**2-1)*b**2 - 2*b*c*q + c**2
    Dx = Bx**2-A*Cx
    #By = q*a**2 + b*(c-p*a)
    #Cy = (p**2+q**2-1)*a**2 - 2*a*c*p + c**2
    #Dy = By**2-A*Cy
    x0 = (-sqrt(Dx)+Bx)/A; y0 = (-x0*a + c)/b;
    x1 = (sqrt(Dx)+Bx)/A; y1 = (-x1*a + c)/b;
    return [x0, y0], [x1, y1]
def dist(p, q, s, t):
    return (p-s)**2 + (q-t)**2
while True:
    n = input()
    if n==0:
        break
    x,y = [0.0]*N,[0.0]*N
    ans = 0
    for i in xrange(n):
        x[i], y[i] = map(float, raw_input().split(','))
    for i in xrange(n):
        for j in xrange(i+1, n):
            rr = dist(x[i], y[i], x[j], y[j])
            if rr<4.00+EPS:
                if rr<EPS:
                    cnt = 2
                    for k in xrange(n):
                        if k==i or k==j:
                            continue
                        if dist(x[i], y[i], x[k], y[k])<1.00+EPS:
                            cnt += 1
                    ans = max(ans, cnt)
                else:
                    xi = [0.0]*2; yi = [0.0]*2
                    [xi[0], yi[0]], [xi[1], yi[1]] = intersection(x[i], y[i], x[j], y[j])
                    for t in xrange(2):
                        #print xi[t],yi[t], "(", i, j,")"
                        cnt = 2
                        for k in xrange(n):
                            if k==i or k==j:
                                continue
                            rri = dist(xi[t], yi[t], x[k], y[k])
                            if rri<1.00+EPS:
                                cnt += 1
                                #print k, rri
                        #print ">>",cnt
                        ans = max(ans, cnt)
    print ans

### FIXED CODE ###

import math
while 1:
    N = int(input())
    if N == 0:
        break

    PS = []
    for i in range(N):
        x, y = map(float, input().split(','))
        PS.append((int(x * 100000), int(y * 100000)))

    D2 = 100000**2
    ans = 0
    for i in range(101):
        py = i * 10000
        for j in range(101):
            px = j * 10000
            cnt = 0
            for x, y in PS:
                if (px - x) ** 2 + (py - y) ** 2 <= D2:
                    cnt += 1
            ans = max(ans, cnt)
    print(ans)
n=int(input())
aa=(map(int,input().split()))
aa.append(0)
aaa=tuple(a)
a=list(aaa)
for i in range(n-1):
    if a[i]<0:
        a[i]=-1*a[i]
        a[i+1]=-1*a[i+1]
b=list(aaa)
for i in range(n,0,-1):
    if b[i]<0:
        b[i]=-1*b[i]
        b[i-1]=-1*b[i-1]

print(max(sum(a),sum(b))


### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
c=0
for i in range(n):
    if a[i]<0:
        c+=1
        a[i]=-1*a[i]
aa=list(map(abs,a))
if c%2==0:
    print(sum(aa))
else:
    print(sum(aa)-2*min(aa))