ZhenlongDai/ACPR huggingface dataset:
Problem: p02265
Buggy submission (Python3, verdict: Wrong Answer):
n = int(input())
data = []

for i in range(n):
	command = input().split()
	if len(command) == 2:
		command,x = command
	else:
		command = command[0]
	print(command)
	if command == 'insert':
		data.insert(0,x)
	elif command == 'delete':
		if x in data:
			data.remove(x)
	elif command == 'deleteFirst':
		print('First')
		data.pop(0)
	elif command == 'deleteLast':
		print('Last')
		data.pop()

print(*data)

Failing test case input:
7
insert 36
tresnj 0
tresni 3
insert 0
deldte 1
nresti 3
delete 7

Expected output:
0 36


Actual output:
insert
tresnj
tresni
insert
deldte
nresti
delete
0 36


Fixed submission (verdict: Accepted):
from collections import deque

n = int(input())
data = deque()

for i in range(n):
	command = input().split()
	if len(command) == 2:
		command,x = command
	else:
		command = command[0]
	if command == 'insert':
		data.appendleft(x)
	elif command == 'delete':
		if x in data:
			data.remove(x)
	elif command == 'deleteFirst':
		data.popleft()
	elif command == 'deleteLast':
		data.pop()

print(*data)

Problem: p02265
Buggy submission (Python3, verdict: Wrong Answer):
n=int(input())
commands=[input().split() for i in range(n)]
print(commands)
    
List=[]
def command(list_command):
    global List
    if 'insert' in list_command:
        List.insert(0,list_command[1])
    elif 'delete' in list_command:
        try:
            t=List.index(list_command[1])
            del List[t]
        except:
            pass
    elif 'deleteFirst' in list_command:
        del List[0]
    elif 'deleteLast' in list_command:
        del List[-1]
    return True
    
for i in commands:
    command(i)
print(*List)

Failing test case input:
7
tresni 5
insert 2
insert 3
insert 1
delete 3
insert 6
delete 5

Expected output:
6 1 2


Actual output:
[['tresni', '5'], ['insert', '2'], ['insert', '3'], ['insert', '1'], ['delete', '3'], ['insert', '6'], ['delete', '5']]
6 1 2


Fixed submission (verdict: Accepted):
from collections import deque
n=int(input())
commands=[input().split() for i in range(n)]
    
List=deque()
for list_command in commands:
    if 'insert' in list_command:
        List.appendleft(list_command[1])
    elif 'delete' in list_command:
        try:
            List.remove(list_command[1])
        except:
            pass
    elif 'deleteFirst' in list_command:
        List.popleft()
    elif 'deleteLast' in list_command:
        List.pop()
  
print(*List)
Problem: p02265
Buggy submission (Python3, verdict: Wrong Answer):
def run():
    n = int(input())
    nodes = []
    for _ in range(n):
        order = [o.strip() for o in input().split()]
        if order[0] == 'insert':
            nodes.append(int(order[1]))
        elif order[0] == 'delete':
            if int(order[1]) in nodes:
                nodes.remove(int(order[1]))
        elif order[0] == 'deleteFirst':
            nodes.pop()
        elif order[0] == 'deleteLast':
            nodes.pop(0)
    nodes.reverse()
    print(' '.join([str(n) for n in nodes]))
    
if __name__ == '__main__':
    run()




Failing test case input:
7
tresni 2
insert 0
insert 3
insert 0
delete 0
insert 3
eteled 2

Expected output:
3 3 0


Actual output:
3 0 3


Fixed submission (verdict: Accepted):
from collections import deque

def run():
    n = int(input())
    dq = deque()
    for _ in range(n):
        order = input()
        if order[0] == 'i':
            dq.appendleft(order[7:])
        elif order[6] == ' ':
            key = order.split()[1]
            if not key in dq:
                continue
            for i in range(len(dq)):
                if dq[i] == key:
                    dq.remove(key)
                    break
        elif order[6] == 'F':
            dq.popleft()
        elif order[6] == 'L':
            dq.pop()

    print(' '.join(dq))

if __name__ == '__main__':
    run()

Problem: p02265
Buggy submission (Python3, verdict: Wrong Answer):
from collections import deque
dq = deque()
for _ in range(int(input())):
    ss = input()
    if ss == "deleteFirst":
        del dq[0]
    elif ss == "deleteLast":
        del dq[-1]
    else:
        c, s = ss.split()
        s = int(s)
        if c == "insert":
            dq.append(s)
        elif c == "delete":
            if s in dq:
                dq.remove(s)
dq.reverse()
print(*dq)



Failing test case input:
7
tresni 2
insert 0
insert 3
insert 0
delete 0
insert 3
eteled 2

Expected output:
3 3 0


Actual output:
3 0 3


Fixed submission (verdict: Accepted):
from collections import deque
dq = deque()
for _ in range(int(input())):
    ss = input()
    if ss == "deleteFirst":
        del dq[0]
    elif ss == "deleteLast":
        del dq[-1]
    else:
        c, s = ss.split()
        s = int(s)
        if c == "insert":
            dq.appendleft(s)
        elif c == "delete":
            if s in dq:
                dq.remove(s)
print(*dq)
Problem: p02265
Buggy submission (Python3, verdict: Wrong Answer):
n = int(input())
data = []

for i in range(n):
	command = input().split()
	if len(command) == 2:
		command,x = command
	else:
		command = command[0]
	if command == 'insert':
		data.insert(0,x)
	elif command == 'delete':
		if x in data:
			data.remove(x)
	elif command == 'deleteFirst':
		print('First')
		data.pop(0)
	elif command == 'deleteLast':
		print('Last')
		data.pop()

print(*data)

Failing test case input:
9
insert 10
insert 2
insert 3
insert 0
delete 3
insert 6
delete 5
deleteFirst
deleteLast

Expected output:
0 2


Actual output:
First
Last
0 2


Fixed submission (verdict: Accepted):
from collections import deque

n = int(input())
data = deque()

for i in range(n):
	command = input().split()
	if len(command) == 2:
		command,x = command
	else:
		command = command[0]
	if command == 'insert':
		data.appendleft(x)
	elif command == 'delete':
		if x in data:
			data.remove(x)
	elif command == 'deleteFirst':
		data.popleft()
	elif command == 'deleteLast':
		data.pop()

print(*data)

Problem: p02265
Buggy submission (Python3, verdict: Wrong Answer):
from collections import deque
n = input()
d = deque()
for i in range(int(n)):
	command = input()
	if command[0] == 'i':
		d.appendleft(command[7:])
	else:
		if command[6] == " ":
			if  command[7:] in d:
				d.remove(command[7:])
		else:
			if command[6] == 'L':
				d.pop()
			else:
				d.popleft()
for _ in range(len(d)-1):
	print(d.pop(), end=" ")
print(d.pop())

Failing test case input:
7
nresti 5
insert 4
insers 3
insert 2
delete 3
insert 6
edleue 5

Expected output:
6 2 4


Actual output:
4 2 6


Fixed submission (verdict: Accepted):
from collections import deque
n = input()
d = deque()
for i in range(int(n)):
	command = input()
	if command[0] == 'i':
		d.appendleft(command[7:])
	else:
		if command[6] == " ":
			if  command[7:] in d:
				d.remove(command[7:])
		else:
			if command[6] == 'L':
				d.pop()
			else:
				d.popleft()
for _ in range(len(d)-1):
	print(d.popleft(), end=" ")
print(d.pop())

Problem: p02265
Buggy submission (Python3, verdict: Wrong Answer):
from collections import deque

n = int(input())
commands = [input() for _ in range(n)] 

l = deque()
for com in commands:
    if com[0]=='i':
        l.appendleft(com[6:-1])
    elif com[6]=='F':
        l.popleft()
    elif com[6]=='L':
        l.pop()
    else:
        try:
            l.remove(com[7:-1])
        except:
            pass

s = ' '.join(l)
print(s)


Failing test case input:
7
tresni 6
insert 2
insert 4
insert 0
delete 3
insert 6
delete 5

Expected output:
6 0 4 2


Actual output:

Fixed submission (verdict: Accepted):
from collections import deque

n = int(input())
commands = [input() for _ in range(n)] 

l = deque()
for com in commands:
    if com[0]=='i':
        l.appendleft(com[7:])
    elif com[6]=='F':
        l.popleft()
    elif com[6]=='L':
        l.pop()
    else:
        try:
            l.remove(com[7:])
        except:
            pass

s = ' '.join(l)
print(s)
Problem: p02265
Buggy submission (Python3, verdict: Wrong Answer):
a=int(input())
list=[]

for i in range(a):
    order=input().split()
    if order[0]=="insert":
        list.append(order[1])
    elif order[0]=="delete":
        if order[1] in list:
            list.remove(order[1])
    elif order[0]=="deleteFirst":
        list.pop(0)
    elif order[0]=="deleteLast":
        list.pop(len(list)-1)

print(*list)


Failing test case input:
9
insert 19
insert 2
insert 2
insert 0
delete 3
insert 6
delete 5
deleteFirst
deleteLast

Expected output:
0 2 2


Actual output:
2 2 0


Fixed submission (verdict: Accepted):
from collections import deque
a=int(input())
list=deque([])

for i in range(a):
    order=input().split()
    if order[0]=="insert":
        list.appendleft(order[1])
    elif order[0]=="delete":
        if order[1] in list:
            list.remove(order[1])
    elif order[0]=="deleteFirst":
        list.popleft()
    elif order[0]=="deleteLast":
        list.pop()

print(*list)

Problem: p02265
Buggy submission (Python3, verdict: Wrong Answer):
import sys
from collections import deque

n = int( sys.stdin.readline( ) )
que = deque( )
lines = sys.stdin.readlines()
for line in lines:
	op = line.split( " " )
	if "insert" == op[0]:
		que.appendleft( op[1] )
	elif "delete" == op[0]:
		if op[1] in que:
			que.remove( op[1] )
	elif "deleteFirst" == op[0] :
		que.popleft( )
	elif "deleteLast" == op[0]:
		que.pop( )


print( " ".join( que ) )

Failing test case input:
7
tresni 5
insert 2
insert 4
insert 1
delete 5
insert 6
deleue 5

Expected output:
6 1 4 2


Actual output:
6
 1
 4
 2



Fixed submission (verdict: Accepted):
import sys
from collections import deque

n = int( sys.stdin.readline( ) )
que = deque( )
lines = sys.stdin.readlines()
for line in lines:
	op = line.rstrip().split( " " )
	if "insert" == op[0]:
		que.appendleft( op[1] )
	elif "delete" == op[0]:
		if op[1] in que:
			que.remove( op[1] )
	elif "deleteFirst" == op[0] :
		que.popleft( )
	elif "deleteLast" == op[0]:
		que.pop( )


print( " ".join( que ) )

Problem: p02265
Buggy submission (Python3, verdict: Wrong Answer):
n = int(input())
q = []
bottom = -1
for i in range(n):
    print(' '.join(q[bottom::-1]))
    cmd = input()
    if cmd[0] == 'i':
        q.append(cmd[7:])
    elif cmd[6] == ' ':
        try:
            q.pop(~q[::-1].index(cmd[7:]))
        except:
            pass
    elif cmd[6] == 'F':
        q.pop()
    else:
        bottom += 1

print(' '.join(q[bottom::-1]))

Failing test case input:
7
tresni 6
insert 2
tresni 3
insert -1
deleet 1
tresni 3
delete 5

Expected output:
-1 2


Actual output:


2
2
-1 2
-1 2
-1 2
-1 2


Fixed submission (verdict: Accepted):
from sys import stdin

n = int(stdin.readline())
q = []
bottom = 0
for i in range(n):
    cmd = stdin.readline()[:-1]
    if cmd[0] == 'i':
        q.append(cmd[7:])
    elif cmd[6] == ' ':
        try:
            q.pop(~q[::-1].index(cmd[7:]))
        except:
            pass
    elif cmd[6] == 'F':
        q.pop()
    else:
        bottom += 1

print(' '.join(q[bottom:][::-1]))
Problem: p02265
Buggy submission (Python3, verdict: Wrong Answer):
n = int(input())
commands = [input().split() for _ in range(n)]

l = []
for com in commands:
    print(l)
    if com[0]=='insert':
        l.insert(0, com[1])
    elif com[0]=='delete':
        try:
            l.remove(com[1])
        except:
            pass
    elif com[0]=='deleteFirst':
        l.pop(0)
    elif com[0]=='deleteLast':
        l.pop()
s = ' '.join(l)
print(s)


Failing test case input:
9
insert 19
insert 3
insert 3
insert 0
delete 6
insert 6
deldte 5
deleteFirst
deleteLast

Expected output:
0 3 3


Actual output:
[]
['19']
['3', '19']
['3', '3', '19']
['0', '3', '3', '19']
['0', '3', '3', '19']
['6', '0', '3', '3', '19']
['6', '0', '3', '3', '19']
['0', '3', '3', '19']
0 3 3


Fixed submission (verdict: Accepted):
from collections import deque

n = int(input())
commands = [input() for _ in range(n)] 

l = deque()
for com in commands:
    if com[0]=='i':
        l.appendleft(com[7:])
    elif com[6]=='F':
        l.popleft()
    elif com[6]=='L':
        l.pop()
    else:
        try:
            l.remove(com[7:])
        except:
            pass

s = ' '.join(l)
print(s)

Problem: p02265
Buggy submission (Python3, verdict: Wrong Answer):
n = int(input())

l = []
for _ in range(n):
    command = input().split()
    if command[0] == "insert":
        l.append(command[1])
    elif command[0] == "delete":
        try:
            ind = l.index(command[1])
            l.pop(ind)
        except ValueError:
            pass
    elif command[0] == "deleteFirst":
        l.pop(0)
    elif command[0] == "deleteLast":
        l.pop(-1)
        
print (" ".join(l[::-1]))

Failing test case input:
7
tresni 2
insert 0
insert 3
insert 0
delete 0
insert 3
eteled 2

Expected output:
3 3 0


Actual output:
3 0 3


Fixed submission (verdict: Accepted):
from collections import deque

n = int(input())

l = deque()
for _ in range(n):
    command = input().split()
    if command[0] == "insert":
        l.appendleft(command[1])
    elif command[0] == "delete":
        try:
            ind = l.remove(command[1])
        except ValueError:
            pass
    elif command[0] == "deleteFirst":
        l.popleft()
    elif command[0] == "deleteLast":
        l.pop()
        
print (" ".join(l))
Problem: p02265
Buggy submission (Python3, verdict: Wrong Answer):
n = int(input())
data = []

for i in range(n):
	command = input().split()
	if len(command) == 2:
		command,x = command
	if command == 'insert':
		data.insert(0,x)
	elif command == 'delete':
		if x in data:
			data.remove(x)
	elif command == 'deleteFirst':
		data.pop(0)
	elif command == 'deleteLast':
		data.pop()

print(*data)

Failing test case input:
9
insert 11
jnsert 3
insert 5
insert 0
delete 3
insert 6
delete 4
deleteFirst
deleteLast

Expected output:
0 5


Actual output:
6 0 5 11


Fixed submission (verdict: Accepted):
from collections import deque

n = int(input())
data = deque()

for i in range(n):
	command = input().split()
	if len(command) == 2:
		command,x = command
	else:
		command = command[0]
	if command == 'insert':
		data.appendleft(x)
	elif command == 'delete':
		if x in data:
			data.remove(x)
	elif command == 'deleteFirst':
		data.popleft()
	elif command == 'deleteLast':
		data.pop()

print(*data)

Problem: p02265
Buggy submission (Python3, verdict: Wrong Answer):


import sys
from collections import deque

n = int(input())

task_name = (
    "insert",
    "delete",
    "deleteFirst",
    "deleteLast"
)

tasks = deque(map(lambda x: x if x in task_name else x.split(), sys.stdin.readlines()))

a = deque()

for task in tasks:
    
    if len(task) == 1:
        if task == "deleteFirst":
            a.popleft()
        else:
            a.pop()
    
    else:
        if task[0] == "insert":
            a.appendleft(task[1])
        elif task[1] in a:
            a.remove(task[1])

print(*a)

Failing test case input:
9
insert 19
insert 3
insert 3
insert 0
delete 6
insert 6
deldte 5
deleteFirst
deleteLast

Expected output:
0 3 3


Actual output:
6 0 3


Fixed submission (verdict: Accepted):


import sys
from collections import deque

n = int(input())

task_name = (
    "insert",
    "delete",
    "deleteFirst",
    "deleteLast",
)

a = deque()

for task in map(lambda x: [x] if x in task_name else x.split(), sys.stdin.readlines()):
    
    if len(task) == 1:
        if task[0] == "deleteFirst":
            a.popleft()
        else:
            a.pop()

    
    else:
        if task[0] == "insert":
            a.appendleft(task[1])
        elif task[1] in a:
            a.remove(task[1])

print(*a)
Problem: p02265
Buggy submission (Python3, verdict: Wrong Answer):
n = int(input().strip())

l = []
for _ in range(n):
    cmd = input()
    if cmd == "deleteFirst":
        l = l[1:]
    elif cmd == "deleteLast":
        l.pop()
    elif cmd.startswith("insert "):
        _, e = cmd.split(" ")
        l = [e] + l
    elif cmd.startswith("delete "):
        try:
            l.remove(e)
        except ValueError:
            pass

print(" ".join(l))

Failing test case input:
7
tresni 6
insert 2
tresni 3
insert -1
deleet 1
tresni 3
delete 5

Expected output:
-1 2


Actual output:
2


Fixed submission (verdict: Accepted):
from collections import deque

q = deque()

n = int(input().strip())

for _ in range(n):
    cmd = input()
    if cmd == "deleteFirst":
        q.popleft()
    elif cmd == "deleteLast":
        q.pop()
    elif cmd.startswith("insert "):
        v = cmd[7:]
        q.appendleft(v)
    elif cmd.startswith("delete "):
        v = cmd[7:]
        try:
            q.remove(v)
        except ValueError:
            pass
print(" ".join(q))

Problem: p02265
Buggy submission (Python3, verdict: Wrong Answer):


import sys
from collections import deque


class Solution:
    @staticmethod
    def doubly_linked_list():
        
        array_length = int(input())
        _input = sys.stdin.readlines()
        task_deque = deque()

        for i in range(array_length):
            action = _input[:-1]
            value = _input[-1]
            if action == 'insert':
                task_deque.appendleft(value)
            elif action == 'deleteFirst':
                task_deque.popleft()
            elif action == 'deleteLast':
                task_deque.pop()
            elif action == 'delete':
                try:
                    task_deque.remove(value)
                except Exception as e:
                    pass
        print(" ".join(task_deque))


if __name__ == '__main__':
    solution = Solution()
    solution.doubly_linked_list()

Failing test case input:
7
insert 5
insert 4
insert 3
insert 1
delete 3
insert 6
delete 5

Expected output:
6 1 4


Actual output:

Fixed submission (verdict: Accepted):


import sys
from collections import deque


class Solution:
    @staticmethod
    def doubly_linked_list():
        
        array_length = int(input())
        task_deque = deque()
        _input = sys.stdin.readlines()

        for i in range(array_length):
            l_arg = _input[i].split()
            action = _input[i].split()[0]
            if len(l_arg) > 1:
                value = _input[i].split()[-1]
            

            if action == 'insert':
                task_deque.appendleft(value)
            elif action == 'deleteFirst':
                task_deque.popleft()
            elif action == 'deleteLast':
                task_deque.pop()
            elif action == 'delete':
                try:
                    task_deque.remove(value)
                except Exception as e:
                    pass
        print(" ".join(task_deque))


if __name__ == '__main__':
    solution = Solution()
    solution.doubly_linked_list()
Problem: p02265
Buggy submission (Python3, verdict: Wrong Answer):
from collections import deque
query = int(input())
l = deque()
for _ in range(query):
    command = input()
    if command == "deleteFirst":
        try:
            l.popleft()
        except:
            pass
    elif command == "deleteLast":
        try:
            l.pop()
        except:
            pass
    else:
        command, value = command.split(" ")
        if command == "insert":
            l.append(int(value))
        elif command == "delete":
            try:
                l.remove(int(value))
            except:
                pass
print(*l)

Failing test case input:
7
insert -2
tioser 0
tresni 0
insert 0
delete 1
tresni 2
delete 4

Expected output:
0 -2


Actual output:
-2 0


Fixed submission (verdict: Accepted):
from collections import deque
query = int(input())
l = deque()
for _ in range(query):
    command = input().strip()
    if command == "deleteFirst":
        try:
            l.popleft()
        except:
            pass
    elif command == "deleteLast":
        try:
            l.pop()
        except:
            pass
    else:
        command, value = command.split(" ")
        if command == "insert":
            l.appendleft(int(value))
        elif command == "delete":
            try:
                l.remove(int(value))
            except:
                pass
print(*l)

Problem: p02265
Buggy submission (Python3, verdict: Wrong Answer):
n = input()
l = []
for i in range(int(n)):
	command = input()
	if command[0] == 'i':
		l.insert(0, command[7:])
	else:
		if command[6] == " ":
			if  command[7:] in l:
				l.remove(command[7:])
		else:
			if command[7] == 'L':
				l.pop()
			else:
				l.pop(0)
for i in l[:-1]:
	print(i, end=' ')
print(l[-1])

Failing test case input:
9
insert 10
insert 2
insert 4
insert 1
delete 3
insert 6
deletd 5
deleteFirst
deleteLast

Expected output:
1 4 2


Actual output:
4 2 10


Fixed submission (verdict: Accepted):
from collections import deque
n = input()
d = deque()
for i in range(int(n)):
	command = input()
	if command[0] == 'i':
		d.appendleft(command[7:])
	else:
		if command[6] == " ":
			if  command[7:] in d:
				d.remove(command[7:])
		else:
			if command[6] == 'L':
				d.pop()
			else:
				d.popleft()
for _ in range(len(d)-1):
	print(d.popleft(), end=" ")
print(d.pop())
Problem: p02265
Buggy submission (Python3, verdict: Wrong Answer):
n = int(input())
q = []
bottom = -1
for i in range(n):
    cmd = input()
    if cmd[0] == 'i':
        q.append(cmd[7:])
    elif cmd[6] == ' ':
        try:
            q.pop(~q[::-1].index(cmd[7:]))
        except:
            pass
    elif cmd[6] == 'F':
        q.pop()
    else:
        bottom += 1

print(' '.join(q[bottom::-1]))

Failing test case input:
9
insert 19
insert 2
insert 3
insert 0
delete 3
tresni 6
delete 5
deleteFirst
deleteLast

Expected output:
2


Actual output:
19


Fixed submission (verdict: Accepted):
from sys import stdin

n = int(stdin.readline())
q = []
bottom = 0
for i in range(n):
    cmd = stdin.readline()[:-1]
    if cmd[0] == 'i':
        q.append(cmd[7:])
    elif cmd[6] == ' ':
        try:
            q.pop(~q[::-1].index(cmd[7:]))
        except:
            pass
    elif cmd[6] == 'F':
        q.pop()
    else:
        bottom += 1

print(' '.join(q[bottom:][::-1]))

Problem: p02265
Buggy submission (Python3, verdict: Wrong Answer):
import sys
from collections import deque
n = int(sys.stdin.readline())

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

print(' '.join(map(str, ans)))

Failing test case input:
9
insert 11
jnsert 3
insert 5
insert 0
delete 3
insert 6
delete 4
deleteFirst
deleteLast

Expected output:
0 5


Actual output:
6 0 5


Fixed submission (verdict: Accepted):
import sys
from collections import deque
n = int(sys.stdin.readline())

ans = deque()

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

print(' '.join(ans))
Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
string = input()
min = 999
for i in range(len(string)-3):
  num = 100 * int(string[i]) + 10 * int(string[i+1]) + int(string[i+2])
  if abs(num-753) < min:
    min = abs(num-753)
print(min)

Failing test case input:
15829

Expected output:
76


Actual output:
171


Fixed submission (verdict: Accepted):
string = input()
min = 999
for i in range(len(string)-2):
  num = 100 * int(string[i]) + 10 * int(string[i+1]) + int(string[i+2])
  if abs(num-753) < min:
    min = abs(num-753)
print(min)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = input()
minans =  753

for i in range(len(a)-2):
    ans = abs(int(a[i:i+3]) - 753)
    if minans > ans:
        minans = ans

print(ans)

Failing test case input:
13574842

Expected output:
5


Actual output:
89


Fixed submission (verdict: Accepted):
a = input()
minans =  753

for i in range(len(a)):
    ans = abs(int(a[i:i+3]) - 753)
    if minans > ans:
        minans = ans

print(minans)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
ans = 753
for i in range(len(S)-3):
  ans = min(ans, abs(int(S[i:i+3])-753))

print(ans)

Failing test case input:
1514858721

Expected output:
32


Actual output:
105


Fixed submission (verdict: Accepted):
S = input()
ans = 753
for i in range(len(S)-2):
  ans = min(ans, abs(int(S[i:i+3])-753))

print(ans)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
l = []
for i in range(len(s)-2):
    l.append(abs(int(s[i:i+3])-753))
print(l)
print(min(l))

Failing test case input:
1000100100

Expected output:
653


Actual output:
[653, 753, 752, 743, 653, 752, 743, 653]
653


Fixed submission (verdict: Accepted):
s = input()
l = []
for i in range(len(s)-2):
    l.append(abs(int(s[i:i+3])-753))
print(min(l))

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
l=len(s)
a=float('inf')
for i in range(l-2):
  x=int(s[i:i+3])
  if abs(x-753)<a:
    ans=x
    a=abs(x-753)
print(ans)

Failing test case input:
120326

Expected output:
427


Actual output:
326


Fixed submission (verdict: Accepted):
s=input()
l=len(s)
ans=float('inf')
for i in range(l-2):
  x=int(s[i:i+3])
  ans=min(abs(x-753), ans)
print(ans)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = str(input())

min = abs(int(S[0:3]) - 753)

for i in range(1, len(S) - 2):
    min_now = abs(int(S[i:i+3]) - 753)
    print(min_now, min, S[i:i+3])
    if min > min_now:
        min = min_now
print(min)


Failing test case input:
19371

Expected output:
184


Actual output:
184 560 937
382 184 371
184


Fixed submission (verdict: Accepted):
S = str(input())

min = abs(int(S[0:3]) - 753)

for i in range(1, len(S) - 2):
    min_now = abs(int(S[i:i+3]) - 753)
    if min > min_now:
        min = min_now
print(min)
Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
li = list(S)
li_b = []
for i in range(len(li) - 2):
  a = int(li[i])*100 + int(li[i+1])*10 + int(li[i+2])
  b = abs(a - 753)
  li_b.append(b)
print(b)
  

Failing test case input:
518385143

Expected output:
85


Actual output:
610


Fixed submission (verdict: Accepted):
S = input()
li = list(S)
li_b = []
for i in range(len(li) - 2):
  a = int(li[i])*100 + int(li[i+1])*10 + int(li[i+2])
  b = abs(a - 753)
  li_b.append(b)
print(min(li_b))

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = list(map(int,input()))
l = len(n)
c = 1000
for i in range(l-2):
    c = min(abs(n[i]*100+n[i+1]*10+n[i]-753),c)
print(c)

Failing test case input:
31099

Expected output:
443


Actual output:
440


Fixed submission (verdict: Accepted):
n = list(map(int,input()))
l = len(n)
c = 1000
for i in range(l-2):
    c = min(abs(n[i]*100+n[i+1]*10+n[i+2]-753),c)
print(c)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
n = len(s)
a = 0
for i in range(n-2):
  if abs(753-a)>abs(753-int(s[i:i+3])):
    a = int(s[i:i+3])
print(753-a)

Failing test case input:
1133184093

Expected output:
87


Actual output:
-87


Fixed submission (verdict: Accepted):
s = input()
n = len(s)
a = 0
for i in range(n-2):
  if abs(753-a)>abs(753-int(s[i:i+3])):
    a = int(s[i:i+3])
print(abs(753-a))

Problem: p03211
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
S = input()
ans = 0

for i in range(len(S) - 2):
    A = abs(753 - int(S[i:i+3]))
    ans = min(A, ans)

print(ans)

Failing test case input:
38621

Expected output:
109


Actual output:
0


Fixed submission (verdict: Accepted):
S = input()
B = 999
for i in range(len(S)-2):
    A = abs(753 - int(S[i:i+3]))
    B = min(A, B)
print(B)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
dis = 1e9
min = ""
for i in range(len(S) - 2):
  text = S[i:i+3]
  if abs(753 - int(text)) < dis:
    dis = abs(753 - int(text))
    min = text
print(text)

Failing test case input:
53216

Expected output:
221


Actual output:
216


Fixed submission (verdict: Accepted):
S = input()
dis = 1e9
min = ""
for i in range(len(S) - 2):
  text = S[i:i+3]
  if abs(753 - int(text)) < dis:
    dis = abs(753 - int(text))
    min = dis
print(min)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
ans_lis = []

flag_lis = []
for _ in range(len(S)-2):
    flag_lis.append(abs(7-int(S[_])))
for _ in flag_lis:
    if _ == min(flag_lis):
        flag = flag_lis.index(_)
        ans_lis.append(int(S[flag:flag+3:]))
print(abs(min(ans_lis)-753))


Failing test case input:
139648651

Expected output:
102


Actual output:
105


Fixed submission (verdict: Accepted):
S = input()
ans_lis = []

flag_lis = [abs(7-int(x)) for x in S[:len(S)-2]]

for _ in range(len(flag_lis)):
    if  flag_lis[_] == min(flag_lis):
        flag = _
        ans_lis.append(int(S[flag:flag+3:]))
tp = [abs(_-753) for _ in ans_lis]
ans = min(tp)
print(ans)
Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
vals = []
for i in range(len(S) - 2):
    vals.append(754 - int(S[i:i+2]))
print(abs(min(vals)))


Failing test case input:
57930

Expected output:
40


Actual output:
661


Fixed submission (verdict: Accepted):
S = input()
vals = []
for i in range(len(S) - 2):
    vals.append(abs(753 - int(S[i:i+3])))
print(min(vals))

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=str(input())
ans=10**9
for i in range(len(s)-3):
    ans=min(ans,abs(753-int(s[i:i+3])))
print(ans)

Failing test case input:
15829

Expected output:
76


Actual output:
171


Fixed submission (verdict: Accepted):
s=str(input())
ans=10**9
for i in range(len(s)-2):
    ans=min(ans,abs(753-int(s[i:i+3])))
print(ans)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()

leng = len(s)

con = 753

ans = 10000000000

for i in range(leng-2):
    temp = int(s[i:i+2])
    ans = ans if abs(temp-con) < ans else abs(temp-con)

print(ans)


Failing test case input:
5255

Expected output:
228


Actual output:
10000000000


Fixed submission (verdict: Accepted):
s = input().rstrip()

leng = len(s)

con = 753

ans = 10000000000


for i in range(leng-2):
    temp = int(s[i:i+3])  
    ans = ans if abs(temp-con) > ans else abs(temp-con)

print(ans)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
ans = 1000
for i in range(len(s) - 3):
  ans = min(ans, abs(int(s[i:i + 3]) - 753))
print(ans)

Failing test case input:
35753

Expected output:
0

Actual output:
178


Fixed submission (verdict: Accepted):
s = input()
ans = 1000
for i in range(len(s) - 2):
  ans = min(ans, abs(int(s[i:i + 3]) - 753))
print(ans)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
from collections import deque
stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  

s = input()
ans = 753
for i in range(len(s) - 3):
    num = int(s[i:i+3])
    ans = min(ans, abs(num-753))
print(ans)

Failing test case input:
7752

Expected output:
1


Actual output:
22


Fixed submission (verdict: Accepted):
import sys
from collections import deque
stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  

s = input()
ans = 753
for i in range(len(s) - 2):
    num = int(s[i:i+3])
    ans = min(ans, abs(num-753))
print(ans)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
min = 753
for i in range(len(s) - 2):
  sub = 753 - int(s[i:i+3])
  if sub < min:
    min = sub
print(str(min))

Failing test case input:
1948

Expected output:
195


Actual output:
-195


Fixed submission (verdict: Accepted):
s = input()
min = 753
for i in range(len(s) - 2):
  sub = abs(753 - int(s[i:i+3]))
  if sub < min:
    min = sub
print(str(min))
Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
text=input()
N=len(text)
ls=[]
for i in range(N):
  ls.append(int(text[i]))
ans=1000
for i in range(N):
  for j in range(i+1,N):
    for k in range(j+1,N):
      a=100*ls[i]+10*ls[j]+ls[k]
      if abs(a-753)<ans:
        ans=abs(a-753)
print(ans)


Failing test case input:
33232

Expected output:
421


Actual output:
420


Fixed submission (verdict: Accepted):
text=input()
N=len(text)
ls=[]
for i in range(N):
  ls.append(int(text[i]))
ans=1000
for i in range(N-2):
  a=100*ls[i]+10*ls[i+1]+ls[i+2]
  if abs(a-753)<ans:
    ans=abs(a-753)
print(ans)

Problem: p03211
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
S = input()

ans = 1000
for i in range(len(S)-2):
    print(abs(int(S[i:i+3])- 753))
    t = abs(int(S[i:i+3])- 753)
    if t < ans:
        ans = t
print(ans)

Failing test case input:
143899

Expected output:
146


Actual output:
610
315
364
146
146


Fixed submission (verdict: Accepted):
S = input()

ans = 1000
for i in range(len(S)-2):
    t = abs(int(S[i:i+3])- 753)
    if t < ans:
        ans = t
print(ans)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = list(input())

ans = 1000
L = len(S)
for i in range(L):
  if L - 1 < i + 2:
    break
  
  s = int("".join(S[i:i+3]))
  ans = min(ans,753-s)

print(ans)


Failing test case input:
8271

Expected output:
74


Actual output:
-74


Fixed submission (verdict: Accepted):
S = list(input())

ans = 1000
L = len(S)
for i in range(L):
  if L - 1 < i + 2:
    break
  
  s = int("".join(S[i:i+3]))
  ans = min(ans,abs(753-s))

print(ans)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from sys import stdin
S = input()

ans = 10**9
for i in range(len(S)-1):
    ans = min(abs(int(S[i:i+2])-753), ans)
print(ans)


Failing test case input:
1948

Expected output:
195


Actual output:
659


Fixed submission (verdict: Accepted):
from sys import stdin
S = input()

ans = 10**9
for i in range(len(S)-2):
    ans = min(abs(int(S[i:i+3])-753), ans)
print(ans)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
d = 999
for i in range (len(s)-3):
  if abs(int(s[i:i+3]) - 753) < d:
    d = abs(int(s[i:i+3]) - 753)
print(d)

Failing test case input:
708

Expected output:
45


Actual output:
999


Fixed submission (verdict: Accepted):
s = input()
d = 999
for i in range (len(s)-2):
  if abs(int(s[i:i+3]) - 753) < d:
    d = abs(int(s[i:i+3]) - 753)
print(d)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=input()
a=[]
for i in range(len(S)):
    
    a.append(abs(int(S[i:i+3])-753))

print(a)

Failing test case input:
26098

Expected output:
144


Actual output:
[493, 144, 655, 655, 745]


Fixed submission (verdict: Accepted):
S=input()
a=[]
for i in range(len(S)):
    
    a.append(abs(int(S[i:i+3])-753))
print(min(a))
Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
a=753
ans=999
for i in range(len(s)-2):
  n=int(s[i:i+3])
  print(n)
  tmp=abs(a-n)
  if tmp<ans:
    ans=tmp
print(ans)


Failing test case input:
80343

Expected output:
50


Actual output:
803
34
343
50


Fixed submission (verdict: Accepted):
s=input()
a=753
ans=999
for i in range(len(s)-2):
  n=int(s[i:i+3])
  tmp=abs(a-n)
  if tmp<ans:
    ans=tmp
print(ans)

Problem: p03211
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
s=input()
ans = 653
for i in range(len(s)-3):
    x = abs(753 - int(s[i:i+3]))
    ans = min(ans,x)
print(ans)

Failing test case input:
12065661

Expected output:
92


Actual output:
97


Fixed submission (verdict: Accepted):
s=input()
ans = 653
for i in range(len(s)-2):
    x = abs(753 - int(s[i:i+3]))
    ans = min(ans,x)
print(ans)

Problem: p03211
Buggy submission (Python (3.8.2), verdict: Wrong Answer):

S = list(map(int,input()))
print(S)
minimam = 987
for i in range(len(S)-2):
    X = 100*S[i] + 10*S[(i+1)] + S[(i+2)]
    if abs(X - 753)<minimam:
        minimam = abs(X - 753)
print(minimam)

Failing test case input:
38621

Expected output:
109


Actual output:
[3, 8, 6, 2, 1]
109


Fixed submission (verdict: Accepted):

S = list(map(int,input()))

minimam = 987
for i in range(len(S)-2):
    X = 100*S[i] + 10*S[(i+1)] + S[(i+2)]
    if abs(X - 753)<minimam:
        minimam = abs(X - 753)
print(minimam)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
x = 753
ans = 1000
for i in range(len(s)):
    y = int(s[i:i+3])
    if x < y:
        x,y = y,x
    p = x - y
    if ans > p:
        ans = p
        
print(ans)


Failing test case input:
978408132

Expected output:
31


Actual output:
138


Fixed submission (verdict: Accepted):
s = input()
x = 753
ans = []
for i in range(len(s)):
    y = int(s[i:i+3])
    p = abs(x - y)
    ans.append(p)
        
print(min(ans))

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
res = 1000
for i in range(3, len(s)):
    res = min(res, abs(753-int(s[i-3:i])))
print(res)

Failing test case input:
23764

Expected output:
11


Actual output:
377


Fixed submission (verdict: Accepted):
s = input()
res = 1000
for i in range(3, len(s)+1):
    res = min(res, abs(753-int(s[i-3:i])))
print(res)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = [int(x) for x in list(input())]
cand = []
for c1, c2, c3 in zip(s, s[1:], s[2:]):
  res = abs(c1 * 100 + c2 * 10 + c3 - 754)
  cand.append(res)
print(min(cand))
  


Failing test case input:
58101

Expected output:
57


Actual output:
56


Fixed submission (verdict: Accepted):
s = [int(x) for x in list(input())]
cand = []
for c1, c2, c3 in zip(s, s[1:], s[2:]):
  res = abs(c1 * 100 + c2 * 10 + c3 - 753)
  cand.append(res)
print(min(cand))
Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
min_ = 10**18
for i in range(len(s)-3):
  min_ = min(min_, abs(753 - int(s[i:i+3])))

Failing test case input:
43594

Expected output:
159


Actual output:

Fixed submission (verdict: Accepted):
s = input()
min_ = 10**18
for i in range(len(s)-2):
  min_ = min(min_, abs(753 - int(s[i:i+3])))

print(min_)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = input()
b = 753
res = float("inf")
l = len(a)

for i in range(0,l-2):
    print(a[i:i+3])
    n = abs(b-int(a[i:i+3]))
    if res > n:
        res = n
        
print(n)


Failing test case input:
18009

Expected output:
47


Actual output:
180
800
009
744


Fixed submission (verdict: Accepted):
a = input()
b = 753
res = float("inf")
l = len(a)

for i in range(0,l-2):
    n = abs(b-int(a[i:i+3]))
    if res > n:
        res = n
        
print(int(res))

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=input()
print(min([abs(int(S[i:i+2])-753) for i in range(len(S)-2)]))

Failing test case input:
58150

Expected output:
62


Actual output:
672


Fixed submission (verdict: Accepted):
S=input()
print(min(abs(int(S[i:i+3])-753) for i in range(len(S)-2)))

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s =str(input())
result=10**9
d=0
for i in range(len(s)-2):
    d=abs(int(s[i])*100+int(s[i+1])*10+int(s[i])-753)
    result=min(d,result)
print(result)

Failing test case input:
5348

Expected output:
219


Actual output:
218


Fixed submission (verdict: Accepted):
s = str(input())
result =10**6
for i in range(len(s)-2):
  t=s[i:i+3]
  result=min(result,abs(int(t)-753))
print(result)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = list(input())
l = []
for i in range(int(len(S))):
    l.append(753 - int(''.join(S[i:i+3])))
print(min(l))

Failing test case input:
38214

Expected output:
68


Actual output:
-68


Fixed submission (verdict: Accepted):
S = list(input())
l = []
for i in range(int(len(S))):
    if (int(len(S[i:i+3]))) == 3:
        l.append(abs(753 - int(''.join(S[i:i+3]))))
print(min(l))

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
imin=753
for i in range(len(s)-2):
	if abs(int(s[i]+s[i+2]+s[i+2])-753)<imin:
		imin=abs(int(s[i]+s[i+2]+s[i+2])-753)
print(imin)

Failing test case input:
385429923

Expected output:
101


Actual output:
91


Fixed submission (verdict: Accepted):
s=input()
imin=753
for i in range(len(s)-2):
	if abs(int(s[i]+s[i+1]+s[i+2])-753)<imin:
		imin=abs(int(s[i]+s[i+1]+s[i+2])-753)
print(imin)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
res = 1000
for i in range(len(S)-2):
  X = int(S[i:i+3])
  res = min(res, X)
print(res)

Failing test case input:
145224

Expected output:
231


Actual output:
145


Fixed submission (verdict: Accepted):
S = input()
res = 1000
for i in range(len(S)-2):
  X = int(S[i:i+3])
  res = min(res, abs(X - 753))
print(res)
Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
L = len(S)

d_min = 999

for i in range(L - 2):
    s = S[i:i+3]
    d = abs(int(s) - 753)
    if d < d_min:
        d_min = d

print(d)


Failing test case input:
33232

Expected output:
421


Actual output:
521


Fixed submission (verdict: Accepted):
S = input()
L = len(S)

d_min = 999

for i in range(L - 2):
    s = S[i:i+3]
    d = abs(int(s) - 753)
    if d < d_min:
        d_min = d

print(d_min)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
 
ans = 100000
for i in range(len(s)-2):
  if (abs(int(s[i:i+2]) - 753) < ans):
    ans = abs(int(s[i:i+2]) - 753)
 
print(ans)
           

Failing test case input:
268976003

Expected output:
7


Actual output:
656


Fixed submission (verdict: Accepted):
s = input()
 
ans = 100000
for i in range(len(s)-2):
  if (abs(int(s[i:i+3]) - 753) < ans):
    ans = abs(int(s[i:i+3]) - 753)
 
print(ans)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=input()
ans=1000
for i in range(len(S)-3):
    ans=min(ans,abs(753-int(S[i:i+3])))
print(ans)


Failing test case input:
2299

Expected output:
454


Actual output:
524


Fixed submission (verdict: Accepted):
S=input()
ans=1000
for i in range(len(S)-2):
    ans=min(ans,abs(753-int(S[i:i+3])))

print(ans)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=str(input())
min_dif = 1000
for i in range(len(S)-2):
  dif = int(S[i:i+3])
  if min_dif > dif:
    min_dif = dif
print(dif)

Failing test case input:
17266

Expected output:
27


Actual output:
266


Fixed submission (verdict: Accepted):
S=str(input())
min_dif = 1000
for i in range(len(S)-2):
  dif = abs( int(S[i:i+3]) - 753)
  if min_dif > dif:
    min_dif = dif
print(min_dif)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=input()
d=10**4
for i in range(len(S)-3):
  dd=abs(753-int(S[i:i+3]))
  d=min(d,dd)
print(d)


Failing test case input:
15829

Expected output:
76


Actual output:
171


Fixed submission (verdict: Accepted):
S=input()
d=10**4
for i in range(len(S)-2):
  dd=abs(753-int(S[i:i+3]))
  d=min(d,dd)
print(d)

Problem: p03211
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
s = input()
m = 1000
for i in range(len(s)-3):
  _s = int(s[i:i+3])
  d = abs(_s - 753)
  m = min(m, d)
print(m)

Failing test case input:
139648651

Expected output:
102


Actual output:
105


Fixed submission (verdict: Accepted):
s = input()
m = 1000
for i in range(len(s)-2):
  _s = int(s[i:i+3])
  d = abs(_s - 753)
  m = min(m, d)
print(m)

Problem: p03211
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math
s=list(input())
a=[]
for i in range(len(s)-2):
  p=100*int(s[i])+10*int(s[i+1])+int(s[i])
  a.append(abs(p-753))
print(min(a))

Failing test case input:
63510

Expected output:
118


Actual output:
117


Fixed submission (verdict: Accepted):
import math
s=list(input())
a=[]
for i in range(len(s)-2):
  p=100*int(s[i])+10*int(s[i+1])+int(s[i+2])
  a.append(abs(p-753))
print(min(a))
Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
ans = 9999
for i in range(len(s) - 2):
    ans = min(ans, abs(int(s[i: i + 3]) - 753))
    print(s[i: i + 3])
print(ans)

Failing test case input:
3411

Expected output:
342


Actual output:
341
411
342


Fixed submission (verdict: Accepted):
s = input()
ans = 9999
for i in range(len(s) - 2):
    ans = min(ans, abs(int(s[i: i + 3]) - 753))
print(ans)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
ans=1000
for i in range(len(s)-2):
    a=abs(int(s[i:i+3])-753)
    if ans>a:
        ans=a
print(a) 

Failing test case input:
145224

Expected output:
231


Actual output:
529


Fixed submission (verdict: Accepted):
s=input()
ans=1000
for i in range(len(s)-2):
    a=abs(int(s[i:i+3])-753)
    if ans>a:
        ans=a
print(ans)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
ans=999
for i in range(len(s)-2):
  ans=min(abs(753-int(s[i:i+2])),ans)
print(ans)

Failing test case input:
12458

Expected output:
295


Actual output:
708


Fixed submission (verdict: Accepted):
s=input()
ans=999
for i in range(len(s)-2):
  ans=min(abs(753-int(s[i:i+3])),ans)
print(ans)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
data = input()
l = list()
for i in range(len(data)-2):
    l.append(abs(753-int(data[i:i+3])))
print(l[-1])

Failing test case input:
26427

Expected output:
111


Actual output:
326


Fixed submission (verdict: Accepted):
data = input()
l = list()
for i in range(len(data)-2):
    l.append(abs(753-int(data[i:i+3])))
print(sorted(l)[0])

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
ret = 10000
for i in range(len(s)-3):
  ret= min(ret, abs(int(s[i:i+3])-753))
print(ret)

Failing test case input:
3415

Expected output:
338


Actual output:
412


Fixed submission (verdict: Accepted):
s = input()
ret = 10000
for i in range(len(s)-2):
  ret= min(ret, abs(int(s[i:i+3])-753))
print(ret)

Problem: p03211
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
trget_num = 753
x = list(input())
list_len = len(x)
uv = list(map(int, x))
print(uv)

list_len = len(uv)
min_heigt = 1000
for x in range(list_len-2):
    nagasa = abs(trget_num - (uv[x] * 100 + uv[x+1] * 10 + uv[x + 2]))
    if min_heigt > nagasa:
        min_heigt = nagasa

print(min_heigt)

Failing test case input:
38265

Expected output:
73


Actual output:
[3, 8, 2, 6, 5]
73


Fixed submission (verdict: Accepted):
trget_num = 753
x = list(input())
list_len = len(x)
uv = list(map(int, x))

list_len = len(uv)
min_heigt = 1000
for x in range(list_len-2):
    nagasa = abs(trget_num - (uv[x] * 100 + uv[x+1] * 10 + uv[x + 2]))
    if min_heigt > nagasa:
        min_heigt = nagasa

print(min_heigt)