Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
while 1:
hit = blow = 0
try: a = [*map(int,input().split(' '))]
except: break
b = [*map(int,input().split(' '))]
for i in range(len(a)):
	if a[i] == b[i]:
		hit += 1
	if a[i] == b[i-1]:
		blow += 1
print(hit, blow)


Fixed submission:
while 1:
	hit = blow = 0
	try: a = list(map(int,input().split()))
	except: break
	b = list(map(int,input().split()))
	for i in range(4):
		if a[i] == b[i]:
			hit += 1
		elif a[i] in b:
			blow += 1
	print(hit, blow)

Buggy python submission (verdict: Runtime Error):
while 1:
hit = blow = 0
try: a = [*map(int,input().split(' '))]
except: break
b = [*map(int,input().split(' '))]
for i in range(len(a)):
	if a[i] == b[i]:
		hit += 1
	if a[i] == b[i-1]:
		blow += 1
print(hit, blow)


Fixed submission:
while 1:
	hit = blow = 0
	try: a = list(map(int,input().split()))
	except: break
	b = list(map(int,input().split()))
	for i in range(4):
		if a[i] == b[i]:
			hit += 1
		elif a[i] in b:
			blow += 1
	print(hit, blow)

Buggy python submission (verdict: Runtime Error):
a = [*map(int,input().split(' '))]
b = [*map(int,input().split(' '))]
for i in range(4):
	if a[i] == b[i]:
		hit += 1
	if a[i] == b[i-1]:
		blow += 1
print(hit, blow)


Fixed submission:
while 1:
	hit = blow = 0
	try: a = list(map(int,input().split()))
	except: break
	b = list(map(int,input().split()))
	for i in range(4):
		if a[i] == b[i]:
			hit += 1
		elif a[i] in b:
			blow += 1
	print(hit, blow)

Buggy python submission (verdict: Runtime Error):
hit = blow = 0
a = [*map(int,input().split(' '))]
b = [*map(int,input().split(' '))]
for i in range(4):
	if a[i] == b[i]:
		hit += 1
		elif a[i] == b[i-1]:
			blow += 1
print(hit, blow)


Fixed submission:
while 1:
	hit = blow = 0
	try: a = list(map(int,input().split()))
	except: break
	b = list(map(int,input().split()))
	for i in range(4):
		if a[i] == b[i]:
			hit += 1
		elif a[i] in b:
			blow += 1
	print(hit, blow)

Buggy python submission (verdict: Runtime Error):
a = [*map(int,input().split(' '))]
b = [*map(int,input().split(' '))]
for i in range(4):
	if a[i] == b[i]:
		hit += 1
		elif a[i] == b[i-1]:
			blow += 1
print(hit, blow)


Fixed submission:
while 1:
	hit = blow = 0
	try: a = list(map(int,input().split()))
	except: break
	b = list(map(int,input().split()))
	for i in range(4):
		if a[i] == b[i]:
			hit += 1
		elif a[i] in b:
			blow += 1
	print(hit, blow)
Buggy python submission (verdict: Runtime Error):
while True:
	x = int(input())
	for i in range(x):
		li = list(input())
		li1 = int("".join(sorted(li)))
		li2 = int("".join(sorted(li,reverse=True)))
		print(li2-li1)


Fixed submission:
ti = int(input())
for i in range(ti):
	x = list(input())
	print(int(''.join(sorted(x,reverse=True))) - int(''.join(sorted(x))))

Buggy python submission (verdict: Runtime Error):
while True:
	x = int(input())
	for i in range(x):
		try:
			li = list(input())
		except:
			break
		li1 = int("".join(sorted(li)))
		li2 = int("".join(sorted(li,reverse=True)))
		print(li2-li1)


Fixed submission:
ti = int(input())
for i in range(ti):
	x = list(input())
	print(int(''.join(sorted(x,reverse=True))) - int(''.join(sorted(x))))

Buggy python submission (verdict: Runtime Error):
while True:
	x = int(input())
	for i in range(x):
		try:
			li = list(input())
		except:
			break
		li1 = int("".join(sorted(li)))
		li2 = int("".join(sorted(li,reverse=True)))
		print(li2-li1)


Fixed submission:
ti = int(input())
for i in range(ti):
	x = list(input())
	print(int(''.join(sorted(x,reverse=True))) - int(''.join(sorted(x))))
Buggy python submission (verdict: Runtime Error):
import math
while True:
	x = math.factorial(int(input()))
	n = list(str(x))
	con = 0
	for i in range(len(n)-1,0,-1):
		if n[i] != '0':
			break
		con += 1
	print(con)


Fixed submission:
import math
while True:
	x = int(input())
	if x == 0: break
	n = list(str(math.factorial(x)))
	con = 0
	for i in range(len(n)-1,0,-1):
		if n[i] != '0':
			break
		con += 1
	print(con)
Buggy python submission (verdict: Runtime Error):
while 1:
	x = float(input())
	s=x
	for i in range(9):
		if i % 2 == 0:
			s = s*2
			x+=s
		if i % 2 == 1:
			s = s/3
			x+=s
	print(x)


Fixed submission:
while 1:
	try:
		x = float(input())
	except:
		break
	s=x
	for i in range(9):
		if i % 2 == 0:
			s = s*2
			x+=s
		if i % 2 == 1:
			s = s/3
			x+=s
	print(x)
Buggy python submission (verdict: Runtime Error):
while True:
	c1, c2, c3 = list(map(int,input().split()))
	deck = [i for i in range(1,11) if i != c1 and i != c2 and i != c3]
	if 20 - c1 - c2 > max(deck) or 20 - c1 - c2 == c3:
		print("YES")
	else:
		print("NO")


Fixed submission:
while True:
	try: c1, c2, c3 = list(map(int,input().split()))
	except: break
	safe = 20 - (c1 + c2)
	deck = [i for i in range(1,11) if i <= safe and i != c1 and i != c2 and i != c3]
	print(["YES","NO"][len(deck) / 7 <= 0.5])
Buggy python submission (verdict: Runtime Error):
s=int(input())
print((s//3600) : (s//60%60) : (s%60))


Fixed submission:
s=int(input())
print(s // 3600, s // 60 % 60, s % 60, sep = ':')

Buggy python submission (verdict: Runtime Error):
s=int(input())
print((s//3600) : (s//60%60) : (s%60))


Fixed submission:
s=int(input())
print(s // 3600, s // 60 % 60, s % 60, sep = ':')
Buggy python submission (verdict: Runtime Error):
input()
A=list([int(i) for i in input().split()])
print(min(A),max(A),sum(A))


Fixed submission:
input()
A=list([int(i) for i in input().split()])
print(min(A),max(A),sum(A))
Buggy python submission (verdict: Runtime Error):
mport sys

for i in sys.stdin.readlines():
    a, b, c, d, e, f = [int(x) for x in i.split()]
    y = (c * d - a * f) / (b * d - a * e)
    x = (c - b * y) / a
    print('{0:.3f} {1:.3f}'.format(x, y))

Fixed submission:
import sys

for i in sys.stdin.readlines():
    a, b, c, d, e, f = [int(x) for x in i.split()]
    y = (c * d - a * f) / (b * d - a * e)
    x = (c - b * y) / a
    print('{0:.3f} {1:.3f}'.format(x, y))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
R = [int(input()) for x in range(n)]
maxv = -2000000000

for j in range(1, n):
    for i in range(j):
        maxv = max(maxv, R[j] - R[i])

print(maxv)

Fixed submission:
n = int(input())
r = [int(input()) for x in range(n)]
maxv = -2000000000
minv = r[0]

for i in range(1, n):
    maxv = max(maxv, r[i] - minv)
    minv = min(minv, r[i])

print(maxv)
Buggy python submission (verdict: Runtime Error):
from collections import deque

n = int(input())
q = deque()

for i in range(n):
    command, num = input().split()
    if command == 'insert':
        q.appendleft(n)
    elif command == 'delete':
        try:
            q.remove(num)
        except Exception as e:
            pass
    elif command == 'deleteFirst':
        q.popleft()
    else:
        q.pop()

print(' '.join(q))

Fixed submission:
from collections import deque
import sys

n = int(sys.stdin.readline())
q = deque()

for i in range(n):
    command = sys.stdin.readline()[:-1]
    if command[0] == 'i':
        q.appendleft(command[7:])
    elif command[6] == ' ':
        try:
            q.remove(command[7:])
        except Exception as e:
            pass
    elif command[6] == 'F':
        q.popleft()
    else:
        q.pop()

print(' '.join(q))

Buggy python submission (verdict: Runtime Error):
from collections import deque

n = int(input())
q = deque()

for i in range(n):
    command, num = input().split()
    if command == 'insert':
        q.appendleft(n)
    elif command == 'delete':
        try:
            q.remove(num)
        except Exception as e:
            pass
    elif command == 'deleteFirst':
        q.popleft()
    else:
        q.pop()

print(' '.join(q))

Fixed submission:
from collections import deque
import sys

n = int(sys.stdin.readline())
q = deque()

for i in range(n):
    command = sys.stdin.readline()[:-1]
    if command[0] == 'i':
        q.appendleft(command[7:])
    elif command[6] == ' ':
        try:
            q.remove(command[7:])
        except Exception as e:
            pass
    elif command[6] == 'F':
        q.popleft()
    else:
        q.pop()

print(' '.join(q))

Buggy python submission (verdict: Runtime Error):
rom collections import deque
import sys

n = int(sys.stdin.readline())
q = deque()

for i in range(n):
    command = sys.stdin.readline()[:-1]
    if command[0] == 'i':
        q.appendleft(command[7:])
    elif command[6] == ' ':
        try:
            q.remove(command[7:])
        except Exception as e:
            pass
    elif command[6] == 'F':
        q.popleft()
    else:
        q.pop()

print(' '.join(q))

Fixed submission:
from collections import deque
import sys

n = int(sys.stdin.readline())
q = deque()

for i in range(n):
    command = sys.stdin.readline()[:-1]
    if command[0] == 'i':
        q.appendleft(command[7:])
    elif command[6] == ' ':
        try:
            q.remove(command[7:])
        except Exception as e:
            pass
    elif command[6] == 'F':
        q.popleft()
    else:
        q.pop()

print(' '.join(q))
Buggy python submission (verdict: Runtime Error):
mport sys

n = int(input())
dic = {}
input_ = sys.stdin.readlines()

for i in input_:
    c, s = i.split()
    if c == 'insert':
        dic[s] = 0
    else:
        if s in dic:
            print('yes')
        else:
            print('no')

Fixed submission:
import sys

n = int(input())
dic = {}
input_ = sys.stdin.readlines()

for i in input_:
    c, s = i.split()
    if c == 'insert':
        dic[s] = 0
    else:
        if s in dic:
            print('yes')
        else:
            print('no')
Buggy python submission (verdict: Runtime Error):
import math
import sys

x1, y1, x2, y2 = [int(x) for x in sys.stdin.readline().split()]
print(math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2))

Fixed submission:
import math
import sys

x1, y1, x2, y2 = [float(x) for x in sys.stdin.readline().split()]
print(math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2))
Buggy python submission (verdict: Runtime Error):
class Dice():

    def __init__(self, label):
        self.label = label

    def north(self):
        self.change([2, 6, 3, 4, 1, 5])

    def west(self):
        self.change([3, 2, 6, 1, 5, 4])

    def east(self):
        self.change([4, 2, 1, 6, 5, 3])

    def south(self):
        self.change([5, 1, 3, 4, 6, 2])

    def change(self, convert):
        num = []
        for i in range(6):
            num.append(self.label[convert[i] - 1])
        self.label = num

    def is_same_dice(self, another_dice):
        for i in range(6):
            if i % 2 == 0:
                self.north()
            else:
                self.west()
            for j in range(4):
                self.rotate()
                if self.label == another_dice:
                    return True
        return False


def main():
    f = [int(x) for x in input().split()]
    s = [int(x) for x in input().split()]

    if Dice(f).is_same_dice(s):
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()

Fixed submission:
class Dice():

    def __init__(self, label):
        self.label = label

    def north(self):
        self.change([2, 6, 3, 4, 1, 5])

    def west(self):
        self.change([3, 2, 6, 1, 5, 4])

    def east(self):
        self.change([4, 2, 1, 6, 5, 3])

    def south(self):
        self.change([5, 1, 3, 4, 6, 2])

    def rotate(self):
        self.change([1, 4, 2, 5, 3, 6])

    def change(self, convert):
        num = []
        for i in range(6):
            num.append(self.label[convert[i] - 1])
        self.label = num

    def is_same_dice(self, another_dice):
        for i in range(6):
            if i % 2 == 0:
                self.north()
            else:
                self.west()
            for j in range(4):
                self.rotate()
                if self.label == another_dice:
                    return True
        return False


def main():
    f = [int(x) for x in input().split()]
    s = [int(x) for x in input().split()]

    if Dice(f).is_same_dice(s):
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
import sys

n = sys.stdin.readlines()
for i in n:
    a, b = [int(x) for x in i.split()]
    if a == 0 and b == 0:
        break
    if a > b:
        print(a + ' ' + b)
    else:
        print(b + ' ' + a)

Fixed submission:
import sys

n = sys.stdin.readlines()
for i in n:
    a, b = [int(x) for x in i.split()]
    if a == 0 and b == 0:
        break
    if a < b:
        print(a, b)
    else:
        print(b, a)
Buggy python submission (verdict: Runtime Error):
import math

r = int(input())
a = r * r * math.pi
b = r * 2 * math.pi
print('{0:f} {1:f}'.format(a, b))

Fixed submission:
import math

r = float(input())
a = r * r * math.pi
b = r * 2 * math.pi
print('{0:f} {1:f}'.format(a, b))

Buggy python submission (verdict: Runtime Error):
import math

r = int(input())
a = r * r * math.pi
b = r * 2 * math.pi
print('{0:f} {1:f}'.format(a, b))

Fixed submission:
import math

r = float(input())
a = r * r * math.pi
b = r * 2 * math.pi
print('{0:f} {1:f}'.format(a, b))
Buggy python submission (verdict: Runtime Error):
rom collections import OrderedDict

cnt = OrderedDict()
for i in range(ord('a'), ord('z') + 1):
    cnt[chr(i)] = 0
s = input().lower()
for i in s:
    if i in cnt:
        cnt[i] += 1
for k, v in cnt.items():
    print('{}:{}'.format(k, v))

Fixed submission:
from collections import OrderedDict
import sys

cnt = OrderedDict()
for i in range(ord('a'), ord('z') + 1):
    cnt[chr(i)] = 0

S = sys.stdin.readlines()
for s in S:
    s = s.lower()
    for i in s:
        if i in cnt:
            cnt[i] += 1

for k, v in cnt.items():
    print('{} : {}'.format(k, v))
Buggy python submission (verdict: Runtime Error):
#include <vector>
#include <iostream>
#include <set>
#include <cstdio>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <cassert>
#include <ctime>
#include <algorithm>
#include <tuple>
#include <algorithm>
#include <limits>
#include <cstring>

using namespace std;
typedef long long ll;
typedef pair<char, int> P;

int main() {
    char k[20];
    scanf("%s", k);
    for (int i = 0; i < strlen(k); i++) {
        k[i] = tolower(k[i]);
    }
    int r = 0;
    while (1) {
        char b[1010];
        scanf("%s", b);
        if (!strcmp(b, "END_OF_TEXT")) {
            break;
        }
        char b2[1010];
        int c = 0;
        for (int i = 0; i <= strlen(b); i++) {
            b[i] = tolower(b[i]);
            if (b[i] == ' ' || b[i] == '\0') {
                b2[c] = '\0';
                if (!strcmp(k, b2)) {
                    r++;
                }
                c = 0;
            } else {
                b2[c] = b[i];
                c++;
            }
            if (b[i] == '\0') break;

        }
    }
    printf("%d\n", ra);
    return 0;
}

Fixed submission:
import sys
k = raw_input().lower()
l = []
for s in sys.stdin:
    if s == 'END_OF_TEXT':
        break
    l += [t.lower() for t in s.strip().split(' ')]
print(l.count(k))
Buggy python submission (verdict: Time Limit Exceeded):
while True:
    n = int(input())
    if n == 0:
        break

    a = []
    for i in range(n):
        a.append(int(input()))

    m = 0
    for i in range(0, len(a)):
        for j in range(i + 1, len(a) + 1):
            m = max(m, sum(a[i:j]))

    print(m)

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

    s = [0]
    for i in range(n):
        s.append(int(input()) + s[i])

    m = -100000 * 5000
    for i in range(0, n):
        for j in range(i + 1, n + 1):
            m = max(m, s[j] - s[i])

    print(m)
Buggy python submission (verdict: Runtime Error):
ans = [,,,]
while True:
  sides = [,,]
  for i in range(3):
    side[i] = int(input())
  sides = sorted(sides)
  if sides[2] >= sides[1] + sides[0]:
    print(ans[0], ans[1], ans[2], ans[3])
    break
  if sides[2]**2 >= sides[1]**2 + sides[0]**2:
    ans[3]+=1
  elif sides[2]**2 == sides[1]**2 + sides[0]**2:
    ans[2]+=1
  else:
    ans[1]+=1


Fixed submission:
ans = [0 for i in range(4)]
while True:
  sides = sorted([int(inp) for inp in input().split()])
  if sides[2] >= sides[1] + sides[0]:
    print(ans[0], ans[1], ans[2], ans[3])
    break
  if sides[2]**2 > sides[1]**2 + sides[0]**2:
    ans[3]+=1
  elif sides[2]**2 == sides[1]**2 + sides[0]**2:
    ans[1]+=1
  else:
    ans[2]+=1
  ans[0]+=1

Buggy python submission (verdict: Runtime Error):
ans = [0 for i in range(4)]
while True:
  sides = sorted([int(input()) for i in range(3)])
  if sides[2] >= sides[1] + sides[0]:
    print(ans[0], ans[1], ans[2], ans[3])
    break
  if sides[2]**2 >= sides[1]**2 + sides[0]**2:
    ans[3]+=1
  elif sides[2]**2 == sides[1]**2 + sides[0]**2:
    ans[2]+=1
  else:
    ans[1]+=1


Fixed submission:
ans = [0 for i in range(4)]
while True:
  sides = sorted([int(inp) for inp in input().split()])
  if sides[2] >= sides[1] + sides[0]:
    print(ans[0], ans[1], ans[2], ans[3])
    break
  if sides[2]**2 > sides[1]**2 + sides[0]**2:
    ans[3]+=1
  elif sides[2]**2 == sides[1]**2 + sides[0]**2:
    ans[1]+=1
  else:
    ans[2]+=1
  ans[0]+=1
Buggy python submission (verdict: Runtime Error):
print(int(input())**3))

Fixed submission:
print(int(input())**3)
Buggy python submission (verdict: Runtime Error):
a=input().split('')
print(int(a[0])*int(a[1]), end=' ')
print(int(a[0]*2+a[1]*2)

Fixed submission:
a=input().split()
print(int(a[0])*int(a[1]), end=' ')
print(int(a[0])*2+int(a[1])*2)

Buggy python submission (verdict: Runtime Error):
a=input().split('')
print(int(a[0])*int(a[1]), end=' ')
print(int(a[0])*2+int(a[1])*2)

Fixed submission:
a=input().split()
print(int(a[0])*int(a[1]), end=' ')
print(int(a[0])*2+int(a[1])*2)
Buggy python submission (verdict: Runtime Error):
print(sorted(intput().split())).join(' ')

Fixed submission:
print(' '.join(sorted(input().split())))

Buggy python submission (verdict: Runtime Error):
print(sorted(input().split())).join(' ')

Fixed submission:
print(' '.join(sorted(input().split())))
Buggy python submission (verdict: Runtime Error):
for i in range(10000)
  line = int(input())
  if line == 0:
    break
  print('Case {}:{}'.format(i+1, line))

Fixed submission:
for i in range(10000):
  line = int(input())
  if line == 0:
    break
  print('Case {}: {}'.format(i+1, line))

Buggy python submission (verdict: Runtime Error):
for i in range(10000)
  line = int(input())
  if line == 0:
    break
  print('Case {}: {}'.format(i+1, line))

Fixed submission:
for i in range(10000):
  line = int(input())
  if line == 0:
    break
  print('Case {}: {}'.format(i+1, line))
Buggy python submission (verdict: Runtime Error):
while True:
  line = input().split()
  if line == '0 0':
    break
  if int(line[0]) < int(line[1]):
    print('{} {}'.format(line[0],line[1]))
  else: print('{} {}'.format(line[1], line[0]))

Fixed submission:
while True:
  line = input()
  if line == '0 0':
    break
  line = line.split()
  if int(line[0]) < int(line[1]):
    print('{} {}'.format(line[0],line[1]))
  else: print('{} {}'.format(line[1], line[0]))
Buggy python submission (verdict: Runtime Error):
inp = input().split
inp = [int(x) for x in inp]
print(inp[0]/inp[1], end=' ')
print(inp[0]%inp[1], end=' ')
print(inp[0]/float(inp[1]))

Fixed submission:
inp = input().split()
inp = [int(x) for x in inp]
print(int(inp[0]/inp[1]), end=' ')
print(inp[0]%inp[1], end=' ')
print('{:f}'.format(inp[0]/float(inp[1])))
Buggy python submission (verdict: Runtime Error):
import math
r=int(input())
print('{} {}'.format(r*r*math.pi, 2*r*math.pi))

Fixed submission:
import math
r=float(input())
print('{} {}'.format(r*r*math.pi, 2*r*math.pi))
Buggy python submission (verdict: Runtime Error):
HW=input().split()
map(int(), HW)
print('#'*HW[1])
for i in range(HW[0]-2):
  print('#',end='')
  print('.'*(HW[1]-2),end='"')
print('#'*HW[1])
print()

Fixed submission:
while True:
  HW=input().split()
  HW=[int(x) for x in HW]
  if HW[0] == 0: break
  print('#'*HW[1])
  for i in range(HW[0]-2):
    print('#',end='')
    print('.'*(HW[1]-2),end='#')
    print()
  print('#'*HW[1])
  print()

Buggy python submission (verdict: Runtime Error):
whlie True:
  HW=input().split()
  HW=[int(x) for x in HW]
  if HW[0] == 0: break
  print('#'*HW[1])
  for i in range(HW[0]-2):
    print('#',end='')
    print('.'*(HW[1]-2),end='"')
  print('#'*HW[1])
  print()

Fixed submission:
while True:
  HW=input().split()
  HW=[int(x) for x in HW]
  if HW[0] == 0: break
  print('#'*HW[1])
  for i in range(HW[0]-2):
    print('#',end='')
    print('.'*(HW[1]-2),end='#')
    print()
  print('#'*HW[1])
  print()

Buggy python submission (verdict: Runtime Error):
whlie True:
  HW=input().split()
  HW=[int(x) for x in HW]
  if HW[0] == 0: break
  print('#'*HW[1])
  for i in range(HW[0]-2):
    print('#',end='')
    print('.'*(HW[1]-2),end='#')
  print('#'*HW[1])
  print()

Fixed submission:
while True:
  HW=input().split()
  HW=[int(x) for x in HW]
  if HW[0] == 0: break
  print('#'*HW[1])
  for i in range(HW[0]-2):
    print('#',end='')
    print('.'*(HW[1]-2),end='#')
    print()
  print('#'*HW[1])
  print()
Buggy python submission (verdict: Time Limit Exceeded):
#coding:utf-8
n = int(input())
prices = [int(input()) for i in range(n)]
max_profit = None

for i in range(n-1):
    purchase = prices[i]
    for j in range(i+1,n):
        selling = prices[j]
        if (not max_profit) or max_profit < selling - purchase:
            max_profit = selling - purchase

print(max_profit)

Fixed submission:
#coding:utf-8
#1_1_D
n = int(input())
prices = [int(input()) for x in range(n)]
maxv = -2 * 10 ** 9
minv = prices[0]
for i in range(1, n):
    maxv = max(maxv, prices[i] - minv)
    minv = min(minv, prices[i])

print(maxv)

Buggy python submission (verdict: Time Limit Exceeded):
#coding:utf-8
#1_1_D
n = int(input())
maxv = -2 * 10 ** 9
prices = [int(input()) for x in range(n)]

for i in range(1, n):
    for j in range(i):
        if prices[i] - prices[j] > maxv:
            maxv = prices[i] - prices[j]

print(maxv)

Fixed submission:
#coding:utf-8
#1_1_D
n = int(input())
prices = [int(input()) for x in range(n)]
maxv = -2 * 10 ** 9
minv = prices[0]
for i in range(1, n):
    maxv = max(maxv, prices[i] - minv)
    minv = min(minv, prices[i])

print(maxv)
Buggy python submission (verdict: Runtime Error):
#coding:utf-8
#1_3_B
from collections import deque

def processing(queue, quantum, total_time):
    """ queue must be deque object """
    if not queue:
        return

    ps_name, ps_time = queue.popleft()
    if ps_time <= quantum:
        total_time += ps_time
        print(ps_name, total_time)
    else:
        total_time += quantum
        ps_time -= quantum
        queue.append([ps_name, ps_time])

    processing(queue, quantum, total_time)


n, quantum = map(int, input().split())
q = deque()
for i in range(n):
    name, time = input().split()
    q.append([name, int(time)])

processing(q, quantum, 0)

Fixed submission:
#coding:utf-8
#1_3_B
from collections import deque

n, quantum = map(int, input().split())
q = deque()
total_time = 0
for i in range(n):
    name, time = input().split()
    q.append([name, int(time)])

while q:
    ps_name, ps_time = q.popleft()
    if ps_time <= quantum:
        total_time += ps_time
        print(ps_name, total_time)
    else:
        total_time += quantum
        ps_time -= quantum
        q.append([ps_name, ps_time])
Buggy python submission (verdict: Runtime Error):
#coding:utf-8
#1_3_C
from collections import deque
n = int(input())
ary = deque()
for i in range(n):
    cmd = input().split()
    if cmd[0] == "insert":
        ary.appendleft(cmd[1])
    elif cmd[0] == "delete":
        ary.remove(cmd[1])
    elif cmd[0] == "deleteFirst":
        ary.popleft()
    elif cmd[0] == "deleteLast":
        ary.pop()

print(" ".join(ary))

Fixed submission:
#coding:utf-8
#1_3_C
from collections import deque
n = int(input())
q = deque()
for i in range(n):
    cmd = input().split()
    if cmd[0] == "insert":
        q.appendleft(cmd[1])
    elif cmd[0] == "delete":
        try:
            q.remove(cmd[1])
        except ValueError:
            pass
    elif cmd[0] == "deleteFirst":
        q.popleft()
    elif cmd[0] == "deleteLast":
        q.pop()

print(" ".join(q))