Buggy python submission (verdict: Runtime Error):
import itertools
 
n = int(input())
p = tuple(map(int,input().split()))
q = tuple(map(int,input().split()))
 
l = [i for i in range(1,n+1)] 
 
x = 0
y = 0
 
m = list(itertools.permutations(l))
 
for i in range(len(m)):
	if m[i] == p:
  		x = i+1
	if m[i] == q:
    	y = i+1
        
print(abs(x-y))

Fixed submission:
import itertools
 
n = int(input())
p = tuple(map(int,input().split()))
q = tuple(map(int,input().split()))
 
l = [i for i in range(1,n+1)] 
 
x = 0
y = 0
 
m = list(itertools.permutations(l))
 
for i in range(len(m)):
	if m[i] == p:
  		x = i+1
	if m[i] == q:
 		y = i+1
        
print(abs(x-y))

Buggy python submission (verdict: Runtime Error):
import itertools
 
n = int(input())
p = tuple(map(int,input().split()))
q = tuple(map(int,input().split()))
 
l = [i for i in range(1,n+1)] 
 
pi = 0
qi = 0
 
m = list(itertools.permutations(l))
 
for i in range(len(m)):
	if m[i] == p:
  		pi = i+1
	if m[i] == q:
    	qi = i+1
        
print(abs(pi-qi))

Fixed submission:
import itertools
 
n = int(input())
p = tuple(map(int,input().split()))
q = tuple(map(int,input().split()))
 
l = [i for i in range(1,n+1)] 
 
x = 0
y = 0
 
m = list(itertools.permutations(l))
 
for i in range(len(m)):
	if m[i] == p:
  		x = i+1
	if m[i] == q:
 		y = i+1
        
print(abs(x-y))

Buggy python submission (verdict: Runtime Error):
import itertools
 
n = int(input())
p = tuple(map(int,input().split()))
q = tuple(map(int,input().split()))

l = [i for i in range(1,N+1)] 

pi = 0
qi = 0
 
m = list(itertools.permutations(l))


#for i in range(len(m)):
#	if m[i] == p:
#  		pi = i+1
#	if m[i] == q:
#    	qi = i+1
 
#print(abs(pi-qi))

print(m[1])

Fixed submission:
import itertools
 
n = int(input())
p = tuple(map(int,input().split()))
q = tuple(map(int,input().split()))
 
l = [i for i in range(1,n+1)] 
 
x = 0
y = 0
 
m = list(itertools.permutations(l))
 
for i in range(len(m)):
	if m[i] == p:
  		x = i+1
	if m[i] == q:
 		y = i+1
        
print(abs(x-y))

Buggy python submission (verdict: Runtime Error):
import itertools
 
n = int(input())
p = tuple(map(int,input().split()))
q = tuple(map(int,input().split()))

l = [i for i in range(1,N+1)] 

pi = 0
qi = 0
 
m = list(itertools.permutations(l))
 
for i in range(len(m)):
	if m[i] == p:
  		pi = i+1
	if m[i] == q:
    	qi = i+1
 
print(abs(pi-qi))

Fixed submission:
import itertools
 
n = int(input())
p = tuple(map(int,input().split()))
q = tuple(map(int,input().split()))
 
l = [i for i in range(1,n+1)] 
 
x = 0
y = 0
 
m = list(itertools.permutations(l))
 
for i in range(len(m)):
	if m[i] == p:
  		x = i+1
	if m[i] == q:
 		y = i+1
        
print(abs(x-y))

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

n = int(input())
l = list(input())
p = list(map(int,input().split()))
q = list(map(int,input().split()))

pi = 0
qi = 0

for i in range(n):
	l[i] = i+1
  
m = itertools.permutations(l, n)
 
for i in range(n):
	if m[i] == p:
  		pi = i+1
	if m[i] == q:
    	qi = i+1

print(abs(pi-qi))

Fixed submission:
import itertools
 
n = int(input())
p = tuple(map(int,input().split()))
q = tuple(map(int,input().split()))
 
l = [i for i in range(1,n+1)] 
 
x = 0
y = 0
 
m = list(itertools.permutations(l))
 
for i in range(len(m)):
	if m[i] == p:
  		x = i+1
	if m[i] == q:
 		y = i+1
        
print(abs(x-y))

Buggy python submission (verdict: Runtime Error):
n = int(input())
l = list(input())
pi = int(input())
qi = int(input())
 
for i in range(n):
	l[i] = i+1
 
p = list(map(int, input().split()))
q = list(map(int, input().split()))
 
m = itertools.permutations(l, n)
 
for i in range(n):
	if l[i] == p
  	pi = i
    
    if l[i] == q
    qi = i
 
print(abs(pi-qi))

Fixed submission:
import itertools
 
n = int(input())
p = tuple(map(int,input().split()))
q = tuple(map(int,input().split()))
 
l = [i for i in range(1,n+1)] 
 
x = 0
y = 0
 
m = list(itertools.permutations(l))
 
for i in range(len(m)):
	if m[i] == p:
  		x = i+1
	if m[i] == q:
 		y = i+1
        
print(abs(x-y))

Buggy python submission (verdict: Runtime Error):
n = int(input())
l = list(input())
pi = int(input())
qi = int(input())

for i in range(n):
	l[i] = i+1

p = list(map(int, input().split()))
q = list(map(int, input().split()))

m = itertools.permutations(l, n)

for i in range(n):
	if l[i] = p
  	pi = i
    
    if l[i] = q
    qi = i

print(abs(pi-qi))    

Fixed submission:
import itertools
 
n = int(input())
p = tuple(map(int,input().split()))
q = tuple(map(int,input().split()))
 
l = [i for i in range(1,n+1)] 
 
x = 0
y = 0
 
m = list(itertools.permutations(l))
 
for i in range(len(m)):
	if m[i] == p:
  		x = i+1
	if m[i] == q:
 		y = i+1
        
print(abs(x-y))