qyliang/CodeNanoFix huggingface dataset:
Title: 会津地鶏

In April 2008, Aizuwakamatsu City successfully attempted to make a 20.85-meter-long yakitori. The chicken used at that time was Aizu local chicken, known for its delicious taste but limited production and high price due to the difficulty of breeding. Today, Ichiro's relatives are visiting, and his mother plans to treat them with chicken hot pot. She instructs Ichiro to buy chicken from a nearby butcher shop, with specific guidelines:

1. Buy more than the specified amount of chicken to avoid running out.
2. Purchase as much Aizu local chicken as possible within the budget (must buy Aizu local chicken).
3. Buy as much regular chicken as possible with the remaining amount after purchasing Aizu local chicken (if budget allows).

When Ichiro visits the butcher shop, he finds that there is a limit on the amount of Aizu local chicken one person can buy due to its scarcity. Given the minimum amount of chicken to buy (q1), budget (b), price of Aizu local chicken per 100 grams (c1), price of regular chicken per 100 grams (c2), and the limit on the amount of Aizu local chicken one person can buy (q2), create a program to output the amounts of Aizu local chicken and regular chicken Ichiro should buy in 100-gram units. If Ichiro cannot buy according to his mother's instructions, output "NA".

Input:
Multiple datasets are provided until a single zero is given to indicate the end of input. Each dataset is in the format:
q1 b c1 c2 q2

The chicken amounts q1 and q2 are specified in 100-gram units. Additionally, b, c1, c2, q1, and q2 are integers between 1 and 1,000,000.

No more than 50 datasets are provided.

Output:
For each dataset, output the amount of Aizu local chicken and regular chicken Ichiro should purchase (separated by a space) or "NA" on a single line.

Sample Input:
(Provided in the original problem)

Output for the Sample Input:
(Provided in the original problem)

# Buggy version:
# Aizu Problem 0186: Aizu Chicken
#
import sys, math, os, bisect

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")


def aizu_chicken(q1, b, c1, c2, q2):
    for i in range(q2, 0, -1):
        cj = i * c1
        normal = int((b - cj) / c2)
        if i + normal < q1:
            continue
        elif normal >= 0:
            print(i, normal)
            break
    else:
        print("NA")


while True:
    inp = [int(_) for _ in input().split()]
    if len(inp) == 1:
        break
    q1, b, c1, c2, q2 = inp[:]
    aizu_chicken(q1, b, c1, c2, q2)

# Fixed version:
# Aizu Problem 0186: Aizu Chicken
#
import sys, math, os, bisect

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")


def aizu_chicken(q1, b, c1, c2, q2):
    for i in range(q2, 0, -1):
        cj = i * c1
        normal = int((b - cj) // c2)
        if i + normal < q1:
            continue
        elif normal >= 0:
            print(i, normal)
            break
    else:
        print("NA")


while True:
    inp = [int(_) for _ in input().split()]
    if len(inp) == 1:
        break
    q1, b, c1, c2, q2 = inp[:]
    aizu_chicken(q1, b, c1, c2, q2)
Title: Baseball Tournament

In the World Baseball Classic (WBC), Japan achieved back-to-back victories! With the increasing popularity of baseball, a baseball tournament was held at Aizu Gakuen High School. In this tournament, a round-robin league was conducted to determine the rankings using the following methods:

1. Teams with more wins are ranked higher.
2. In case of equal wins, the team with fewer losses is ranked higher.

Create a program that takes input of each team's performance and outputs the team names in descending order of ranking. If teams have the same ranking, output them in the order they were input. The number of teams, n, is an integer between 2 and 10. Each team name, t, is a single alphanumeric character. The performance for each match, r, is represented by n-1 numbers, where 0 denotes a win, 1 denotes a loss, and 2 denotes a draw. Team names are unique.

Input:
Multiple datasets are provided as input until a single line with a zero is encountered. Each dataset is in the following format:

n
score1
score2
...
scoren

The first line contains the number of teams, n (2 ≤ n ≤ 10), followed by n lines containing the performance score of each team, scorei. Each score is in the format:

t r1 r2 ... rn-1

where t is the team name (a single alphanumeric character) and ri represents the performance of team t in each match (0, 1, or 2), separated by spaces.

The number of datasets does not exceed 50.

Output:
For each dataset, output the team names in descending order of ranking.

Sample Input:
6
A 1 0 0 2 0
B 0 0 1 1 0
C 1 1 1 1 1
D 1 0 0 1 2
E 2 0 0 0 0
F 1 1 0 2 1
4
g 1 1 1
h 0 1 2
w 0 0 0
b 0 2 1
0

Output for the Sample Input:
E
A
B
D
F
C
w
h
b
g

# Buggy version:
import sys
f = sys.stdin

while True:
    n = int(f.readline())
    if n == 0:
        break
    teams = [f.readline().split() for i in range(n)]
    
    teams = [(t[0], -t.count('0'), t.count('1'), i) for i, t in enumerate(teams)]
    
    teams.sort(key=operator.itemgetter(1,2,3))
    
    print('\n'.join([t[0] for t in teams]))

# Fixed version:
import sys
import operator
f = sys.stdin

while True:
    n = int(f.readline())
    if n == 0:
        break
    teams = [f.readline().split() for i in range(n)]
    
    teams = [(t[0], -t.count('0'), t.count('1'), i) for i, t in enumerate(teams)]
    
    teams.sort(key=operator.itemgetter(1,2,3))
    
    print('\n'.join([t[0] for t in teams]))
Title: Hospital Room Numbers

In the town of Waterdeben, architect Mr. Debenkey received a request to renovate an old hospital. Some people dislike using certain numbers as room numbers due to superstitions (in Japan, 4 and 9 are famous examples). However, the hospital's room numbers were assigned sequentially from 1, regardless of superstitions.

Mr. Debenkey, concerned about superstitions in Waterdeben, renumbered the rooms excluding the unlucky numbers 4 and 6 before the equipment and bed rearrangement was completed. However, the remaining tasks were planned using the old room numbers, so it's necessary to convert the old room numbers to the new ones. Mr. Debenkey, not good at calculations, is dismayed by this realization.

For Mr. Debenkey's sake, create a program that takes the old room number as input and outputs the corresponding new room number.

The table for the first 15 room numbers is as follows:

Old Room Number: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
New Room Number: 1 2 3 5 7 8 9 10 11 12 13 15 17 18 19

Input:
Multiple datasets are given as input. The end of input is indicated by a single line containing zero. Each dataset consists of an integer n (1 ≤ n ≤ 1,000,000,000) representing the old room number.

The number of datasets does not exceed 30,000.

Output:
For each input dataset, output the new room number on a single line.

Sample Input:
15
100
1000000000
3
0

Output for the Sample Input:
19
155
9358757000
3

# Buggy version:
def ge(arr):
    for i in range(len(arr)):
        tmp = int(arr[i])
        if tmp >= 4:
            tmp += 1
        if tmp >= 6:
            tmp += 1
        arr[i] = str(tmp)


while True:
    n = int(input)
    if n == 0:
        break
    print("".join(ge(list(oct(n))[2:])))


# Fixed version:
def ge(arr):
    for i in range(len(arr)):
        tmp = int(arr[i])
        if tmp >= 4:
            tmp += 1
        if tmp >= 6:
            tmp += 1
        arr[i] = str(tmp)
    return arr


while True:
    n = int(input())
    if n == 0:
        break
    print("".join(ge(list(oct(n))[2:])))
Title: Class Assignment

At Aizu Academy, students take proficiency tests in math, English, and Japanese upon entering the academy to determine their class assignment (A, B, or C). Class A represents the highest level, followed by B and then C.

The class assignment is based on the following criteria:

- If a subject has a score of 100, the student is assigned to class A.
- If the average score of math and English is 90 or above, the student is assigned to class A.
- If the average score of all three subjects is 80 or above, the student is assigned to class A.
- If the average score of all three subjects is 70 or above, the student is assigned to class B.
- If the average score of all three subjects is 50 or above and either math or English has a score of 80 or above, the student is assigned to class B.
- If none of the above conditions are met, the student is assigned to class C.

In cases where multiple conditions are met, the student is assigned to the higher-level class.

The program should take as input the number of students (n) (1 ≤ n ≤ 10000), the math scores (pm_i), English scores (pe_i), and Japanese scores (pj_i) for each student (0 ≤ pm_i, pe_i, pj_i ≤ 100), and output the class assignment (A, B, or C) for each student.

Input:
Multiple datasets are provided as input, with a single line containing a single zero indicating the end of the input. Each dataset is in the following format:
n
pm_1 pe_1 pj_1
pm_2 pe_2 pj_2
...
pm_n pe_n pj_n

All input values are integers, and the number of datasets does not exceed 1000.

Output:
For each input dataset, output the class assignment for each student in order.

Sample Input:
4
100 70 20
98 86 55
80 34 36
65 79 65
2
99 81 20
66 72 90
0

Output for the Sample Input:
A
A
B
C
A
B

# Buggy version:
n=int(input())
while True:
  if n==0:
    break
  for i in range(n):
    m,e,j=map(int,input().split())
    if m==100 or e==100 or j==100:
      print('{}'.format('A'))
    elif (m+e)/2>=90:
       print('{}'.format('A'))
    elif (m+e+j)/3>=80:
       print('{}'.format('A'))
    elif (m+e+j)/3>=70:
       print('{}'.format('B'))
    elif (m+e+j)/3>=50:
      if m>=80 or e>=80:
          print('{}'.format('B'))
      else:
        print('{}'.format('C'))
    else:
      print('{}'.format('C'))


# Fixed version:
while True:
    n = int(input())
    if n==0: break

    for i in range(n):
        m,e,j = map(int,input().split())
        if (m==100 or e==100 or j ==100) or ((m+e)/2 >= 90) or ((m+e+j)/3 >=80):
            print("A")
        elif((m+e+j)/3 >=70) or (((m+e+j)/3>=50) and (m>=80 or e>=80)):
            print("B")
        else:
            print("C")
Title: Histogram

TenA Ice Cream is a shop that always displays 10 types of ice cream. The manager creates a graph daily to track the sales of each ice cream for product development reference.

You are tasked with creating a program to display the sales of each ice cream as a graph for the manager. The input consists of the total number of ice creams sold in a day and the numbers of the sold ice creams. Create a program to output the number of sales for each type of ice cream using asterisks (*), and a hyphen (-) for types with zero sales. Ice cream types are represented by integers from 0 to 9.

Input:
Multiple datasets are provided as input until a single zero is encountered at the end. Each dataset is in the following format:
n
c1
c2
...
cn
Where n (1 ≤ n ≤ 10000) represents the total number of ice creams sold in a day, and the following n lines represent the type ci (0 ≤ ci ≤ 9) of the ice creams sold.

The number of datasets does not exceed 20.

Output:
For each input dataset, output the sales count for each type of ice cream in ascending order of their numbers.

Sample Input:
15
2
6
7
0
1
9
8
7
3
8
9
4
8
2
2
3
9
1
5
0

Output for the Sample Input:
*
*
***
*
*
-
*
**
***
**
-
*
-
-
-
*
-
-
-
*

# Buggy version:
n=int(input())
x=[0 for i in range(10)]
while True:
  if n==0:
    break
  for i in range(n):
    a=int(input())
    if a==0:
      x[0]+=1
    elif a==1:
      x[1]+=1
    elif a==2:
      x[2]+=1
    elif a==3:
      x[3]+=1
    elif a==4:
      x[4]+=1
    elif a==5:
      x[5]+=1 
    elif a==6:
      x[6]+=1
    elif a==7:
      x[7]+=1
    elif a==8:
      x[8]+=1
    else:
      x[9]+=1
  for i in range(10):
    if x[i]==0:
      print('{}'.format('-')) 
    else:
      print('{}'.format(x[i]*'*'))


# Fixed version:
while True:
  n=int(input())
  x=[0 for i in range(10)]
  if n==0:
    break
  for i in range(n):
    a=int(input())
    if a==0:
      x[0]+=1
    elif a==1:
      x[1]+=1
    elif a==2:
      x[2]+=1
    elif a==3:
      x[3]+=1
    elif a==4:
      x[4]+=1
    elif a==5:
      x[5]+=1 
    elif a==6:
      x[6]+=1
    elif a==7:
      x[7]+=1
    elif a==8:
      x[8]+=1
    else:
      x[9]+=1
  for i in range(10):
    if x[i]==0:
      print('{}'.format('-')) 
    else:
      print('{}'.format(x[i]*'*'))

# Buggy version:
#!/usr/bin/env python3

while True:
    n = int(input())
    data = [0] * 10
    if n == 0:
        break

    for _ in range(n):
        in_data = int(input())
        data[in_data - 1] += 1

    for d in data:
        for _ in range(d):
            print("*", end="")

        if d == 0:
            print("-")
        else:
            print(end="\n")

# Fixed version:
#!/usr/bin/env python3

while True:
    n = int(input())
    data = [0] * 10
    if n == 0:
        break

    for _ in range(n):
        in_data = int(input())
        data[in_data] += 1

    for d in data:
        if d == 0:
            print("-")
        else:
            print("*" * d)
You are given a positive integer N. Find the number of pairs of integers u and v (0≦u,v≦N) such that there exist two non-negative integers a and b satisfying a xor b=u and a+b=v. Compute the answer modulo 10^9+7. The input is given as N, and the output should be the number of possible pairs of integers u and v, modulo 10^9+7.

# Buggy version:
N= int(input())

bit = bin(N)[2:]
k = len(bit)
dp = [[0] * 2 for i in range(len(bit) + 1)]
for i in range(k):
	j = int(bit[k-i+1])
	a,b,c = [(1,0,0),(1,1,0)][j]
	d,e,f = [(2, 1, 1),(1, 2, 2)][j]
	dp[i+1][0] = a * dp[i][0] + b * dp[i][1] + c * 3**i
	dp[i+1][1] = d * dp[i][0] + e * dp[i][1] + f * 3**i

print(dp[k][0])
    
        


# Fixed version:
N= int(input())
bit = bin(N)[2:]
k = len(bit)
dp = [[0] * 2 for i in range(len(bit) + 1)]
dp[0][0] = 1
dp[0][1] = 1
for i in range(k):
	j = int(bit[k-i-1])
	a,b,c = [(1,0,0),(1,1,0)][j]
	d,e,f = [(1, 1, 1),(0, 1, 2)][j]
	dp[i+1][0] = (a * dp[i][0] + b * dp[i][1] + c * 3**i) % 1000000007
	dp[i+1][1] = d * dp[i][0] + e * dp[i][1] + f * 3**i % 1000000007

print(dp[k][0])
You are given N cities, K roads, and L railways connecting the cities. Each road connects two cities bidirectionally, as do the railways. For each city, find the number of cities connected to it by both roads and railways. Constraints: 2 ≤ N ≤ 2*10^5, 1 ≤ K, L ≤ 10^5, 1 ≤ p_i, q_i, r_i, s_i ≤ N, p_i < q_i, r_i < s_i, and no two roads or railways connect the same pair of cities. Input format: N, K, L, followed by K lines of road connections and L lines of railway connections. Output N integers representing the number of cities connected to each city by both roads and railways. Example inputs and outputs are provided.

# Buggy version:

def f(m, r):
    connmap = [[] for _ in range(m + 1)]
    for _ in range(r):
        a, b = map(int, input().split())
        connmap[a].append(b)
        connmap[b].append(a)
    group = [0] * (m + 1)
    num = 0
    for i in range(1, m + 1):
        if group[i] > 0:
            continue
        if len(connmap[i]) == 0:
            continue
        num += 1
        group[i] = num
        for j in connmap[i]:
            group[j] = num
        bfs = connmap[i]
        while len(bfs) > 0:
            tmp = []
            for j in bfs:
                for k in connmap[j]:
                    if group[k] > 0:
                        continue
                    group[k] = num
                    tmp.append(k)
            bfs = tmp
    return group

n, k, l = map(int, input().split())

road = f(n, k)
rail = f(n, l)

count = {}

for i in range(1, n + 1):
    key = '{0} {1}'.format(road[i], rail[i])
    if key in count:
        count[key] += 1
    else:
        count[key] = 1
    
for i in range(1, n + 1):
    key = '{0} {1}'.format(road[i], rail[i])
    print(count[key], end=' ' if i < n else '')
print()



# Fixed version:

def f(m, r):
    connmap = [[] for _ in range(m + 1)]
    for _ in range(r):
        a, b = map(int, input().split())
        connmap[a].append(b)
        connmap[b].append(a)
    group = [0] * (m + 1)
    num = 0
    for i in range(1, m + 1):
        if group[i] > 0:
            continue
        num += 1
        group[i] = num
        for j in connmap[i]:
            group[j] = num
        bfs = connmap[i]
        while len(bfs) > 0:
            tmp = []
            for j in bfs:
                for k in connmap[j]:
                    if group[k] > 0:
                        continue
                    group[k] = num
                    tmp.append(k)
            bfs = tmp
    return group

n, k, l = map(int, input().split())

road = f(n, k)
rail = f(n, l)

count = {}

for i in range(1, n + 1):
    key = '{0} {1}'.format(road[i], rail[i])
    if key in count:
        count[key] += 1
    else:
        count[key] = 1
    
for i in range(1, n + 1):
    key = '{0} {1}'.format(road[i], rail[i])
    print(count[key], end=' ' if i < n else '')
print()
In the game of Nim, a cheetah and a cheater take turns removing stones from piles. The cheater can eat zero or one stone from each pile before the game starts to ensure a win. Find the minimum number of stones the cheater must eat to guarantee a win, or print -1 if winning is impossible. The input consists of the number of piles and the number of stones in each pile. Output the minimum number of stones the cheater will eat.

# Buggy version:
n = int(input())
A = [int(input()) for _ in range(n)]
m = 30
C = [False]*m
x = 0
for a in A:
  x ^= a
  for i in range(m):
    if a>>i & 1:
      C[i] = True
total = 0
ans = 0
for i in range(m):
  if (x>>i & 1) ^ total:
    if C[i]:
      ans += 1
      total ^= 1
    else:
      print(-1)
      break
else:
  print(ans)

# Fixed version:
n = int(input())
A = [int(input()) for _ in range(n)]
m = 30
C = [False]*m
x = 0
for a in A:
  x ^= a
  for i in range(m):
    if a>>i & 1:
      C[i] = True
      break
total = 0
ans = 0
for i in range(m-1, -1, -1):
  if (x>>i & 1) ^ total:
    if C[i]:
      ans += 1
      total ^= 1
    else:
      print(-1)
      break
else:
  print(ans)

# Buggy version:
def main():
    n = int(input())
    a = [int(input()) for _ in [0]*n]
    m = max(a)
    xor = 0
    for i in a:
        xor ^= i
    i = 1
    cnt = 0
    while True:
        if xor >= i:
            i *= 2
            cnt += 1
        else:
            break
    ans = 0
    for i in range(cnt-1, -1, -1):
        j = (xor & 2**i) // (2**i)
        if j == 1:
            for k in a:
                if k % (2**i) == 0:
                    xor ^= k
                    xor ^= k-1
                    ans += 1
                    a.remove(k)
                    break
            else:
                print(-1/0)
                return 0
    print(ans)


main()

# Fixed version:
def main():
    n = int(input())
    a = [int(input()) for _ in [0]*n]
    xor = 0
    for i in a:
        xor ^= i
    i = 1
    cnt = 0
    while True:
        if xor >= i:
            i *= 2
            cnt += 1
        else:
            break
    ans = 0
    for i in range(cnt-1, -1, -1):
        j = (xor & 2**i) // (2**i)
        if j == 1:
            for k in a:
                if (k & 2**i) // (2**i) == 1 and k % (2**i) == 0:
                    xor ^= k
                    xor ^= k-1
                    ans += 1
                    a.remove(k)
                    break
            else:
                print(-1)
                return 0
    print(ans)


main()

# Buggy version:
n,*a=map(int,open(0))
x=0
c=[0]*30
for i in a:
  x^=i
  c[bin(i^i-1)[::-1].rfind('1')]=1
a=0
for i in range(29,-1,-1):
  if x&2**i:
    if c[i]:
      a+=1
      x^=2**i-1
  else:
    print(-1)
    break
else:
  print(a)

# Fixed version:
n,*a=map(int,open(0))
x=0
c=[0]*30
for i in a:
  x^=i
  c[bin(i^i-1)[::-1].rfind('1')]=1
a=0
for i in range(29,-1,-1):
  if x&2**i:
    if c[i]:
      a+=1
      x^=2**i-1
    else:
      print(-1)
      break
else:
  print(a)
You are given a 3x3 grid with integers in each square. A magic square has the property that the sum of integers in each row, column, and diagonal is the same. Given integers A, B, and C at specific positions in the magic square, determine the remaining integers. Constraints: 0 ≤ A, B, C ≤ 100. Input format: A, B, C. Output format: The integers in the magic square. Example input/output provided.

# Buggy version:
a=int(input())
b=int(input())
c=int(input())

li1=[a,b,3*c-a-b]
li2=[4*c-2*a-b,2*c-b,2*a+b-2*c]
li3=[a+b-c,2*c-b,2*c-a]
print(*li1)
print(*li2)
print(*li3)

# Fixed version:
a=int(input())
b=int(input())
c=int(input())

li1=[a,b,3*c-a-b]
li2=[4*c-2*a-b,c,2*a+b-2*c]
li3=[a+b-c,2*c-b,2*c-a]
print(*li1)
print(*li2)
print(*li3)

# Buggy version:
a,b,c=[input() for _ in range(3)]
s=3*c
print(a,b,s-a-b)
print(2*s-2*a-b-2*c,c,2*a+b+c-s)
print(a+b+2*c-s,s-b-c,s-a-c)

# Fixed version:
a,b,c=[int(input()) for _ in range(3)]
s=3*c
print(a,b,s-a-b)
print(2*s-2*a-b-2*c,c,2*a+b+c-s)
print(a+b+2*c-s,s-b-c,s-a-c)

# Buggy version:
a = int(input())
b = int(input())
c = int(input())

l = [
    [a, b, -a-b],
    [-2*a-b-2*c, c, 2*a+b+c],
    [a+b+2*c, -b-c, -a-c]
]

for i in l:
    print(*i)


# Fixed version:
a = int(input())
b = int(input())
c = int(input())
s = 3 * c

l = [
    [a, b, s-a-b],
    [2*s-2*a-b-2*c, c, 2*a+b+c-s],
    [a+b+2*c-s, s-b-c, s-a-c]
]

for i in l:
    print(*i)

# Buggy version:
a=int(input())
b=int(input())
c=int(input())
print(a,b,c)
print(a,b,-a-b+3*c)
print(-2*a-b+4*c,c,2*a+b-2*c)
print(a+b-c,-b+2*c,-a+2*c)

# Fixed version:
a=int(input())
b=int(input())
c=int(input())
print(a,b,3*c-a-b)
print(4*c-2*a-b,c,-2*c+2*a+b)
print(a+b-c,2*c-b,2*c-a)
Takahashi is drawing a segment on grid paper. Given two squares on the grid, find the number of squares crossed by the segment connecting the lower left corners of the two squares. The segment is said to cross a square if it has a non-empty intersection with the region within the square, excluding the boundary. The input consists of four integers A, B, C, and D, and the output should be the number of squares crossed by the segment. The constraints are 1 ≤ A, B, C, D ≤ 10^9, and at least one of A ≠ C and B ≠ D holds.

# Buggy version:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

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

if a == c or b == d:
    print(0)
    sys.exit(0)

def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a % b)

x = abs(a - c)
y = abs(b - d)

_gcd = gcd(x, y)
x2 = x // _gcd
y2 = y // _gcd

import math

print(x2, y2)
print((math.ceil(y2 / x2) * x2) * _gcd)


# Fixed version:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

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

if a == c or b == d:
    print(0)
    sys.exit(0)

def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a % b)

x = abs(a - c)
y = abs(b - d)

_gcd = gcd(x, y)
x2 = x // _gcd
y2 = y // _gcd

import math

print((x2 + y2 - 1) * _gcd)
You are given a positive integer X. Find the maximum integer N such that f(N) = X, where f(N) is the maximum possible number of times to perform a specific operation on a cord with length N. The operation involves cutting the cord at two positions to obtain three cords, discarding the longest and shortest lengths, and keeping the remaining one. The length of the cord is a positive integer, and the operation continues until the length becomes at most 2. The constraints are 1 ≤ X ≤ 40. The input is given as X, and the output should be the value of the maximum integer N. For example, if the input is 2, the output should be 14.

# Buggy version:
print(4<<int(input())-2)

# Fixed version:
print((4<<int(input()))-2)