Buggy python submission (verdict: Time Limit Exceeded):
import copy

N = int(input())
X = list(map(int, input().split()))
S_X = copy.copy(X)

for i in range(N // 2 + 1):
    for j in range(N - 1 - i):
        if(S_X[j] > S_X[j + 1]):
            tmp = S_X[j + 1]
            S_X[j + 1] = S_X[j]
            S_X[j] = tmp
# s_X = sorted(X)
miX = S_X[N // 2 - 1]
mi1X = S_X[N // 2]
# print(S_X, X)
# print(miX, mi1X)

# print(miX, mi1X)
# print(X)
for a in X:
    if(a <= miX):
        print(mi1X)
    else:
        print(miX)

Fixed submission:
# import copy

N = int(input())
X = list(map(int, input().split()))
# S_X = copy.copy(X)
S_X = sorted(X)
miX = S_X[N // 2 - 1]
mi1X = S_X[N // 2]
# print(S_X, X)
# print(miX, mi1X)

# print(miX, mi1X)
# print(X)
for a in X:
    if(a <= miX):
        print(mi1X)
    else:
        print(miX)

Buggy python submission (verdict: Time Limit Exceeded):
import copy

N = int(input())
X = list(map(int, input().split()))
S_X = copy.copy(X)

for i in range(N // 2 + 1):
    for j in range(N - 1 - i):
        if(S_X[j] > S_X[j + 1]):
            tmp = S_X[j + 1]
            S_X[j + 1] = S_X[j]
            S_X[j] = tmp
# s_X = sorted(X)
miX = S_X[N // 2 - 1]
mi1X = S_X[N // 2]
# print(S_X, X)
# print(miX, mi1X)

# print(miX, mi1X)
# print(X)
for a in X:
    if(S_X.index(a) <= N // 2 - 1):
        print(mi1X)
    else:
        print(miX)

Fixed submission:
# import copy

N = int(input())
X = list(map(int, input().split()))
# S_X = copy.copy(X)
S_X = sorted(X)
miX = S_X[N // 2 - 1]
mi1X = S_X[N // 2]
# print(S_X, X)
# print(miX, mi1X)

# print(miX, mi1X)
# print(X)
for a in X:
    if(a <= miX):
        print(mi1X)
    else:
        print(miX)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
X = list(map(int, input().split()))

s_X = sorted(X)
miX = s_X[N // 2 - 1]
mi1X = s_X[N // 2]

# print(miX, mi1X)
# print(X)
for a in X:
    if(s_X.index(a) <= N // 2 - 1):
        print(mi1X)
    else:
        print(miX)

Fixed submission:
# import copy

N = int(input())
X = list(map(int, input().split()))
# S_X = copy.copy(X)
S_X = sorted(X)
miX = S_X[N // 2 - 1]
mi1X = S_X[N // 2]
# print(S_X, X)
# print(miX, mi1X)

# print(miX, mi1X)
# print(X)
for a in X:
    if(a <= miX):
        print(mi1X)
    else:
        print(miX)

Buggy python submission (verdict: Runtime Error):
N = int(input())
X = list(map(int, input().split()))
 
s_X = sorted(X)
miX = s_X[N//2]
mi1X = s_X[N//2 + 1]
 
for a in X:
  if(s_X.index(a)<=N//2):
    print(mi1X)
  else:
    print(miX)

Fixed submission:
# import copy

N = int(input())
X = list(map(int, input().split()))
# S_X = copy.copy(X)
S_X = sorted(X)
miX = S_X[N // 2 - 1]
mi1X = S_X[N // 2]
# print(S_X, X)
# print(miX, mi1X)

# print(miX, mi1X)
# print(X)
for a in X:
    if(a <= miX):
        print(mi1X)
    else:
        print(miX)

Buggy python submission (verdict: Runtime Error):
N = int(input())
X = list(map(int, input().split()))
 
s_X = sorted(X)
miX = s_X[N//2]
mi1X = s_X[N//2 + 1]
 
for a in X:
  if(a.find(s_X)<=N//2):
    print(mi1X)
  else:
    print(miX)

Fixed submission:
# import copy

N = int(input())
X = list(map(int, input().split()))
# S_X = copy.copy(X)
S_X = sorted(X)
miX = S_X[N // 2 - 1]
mi1X = S_X[N // 2]
# print(S_X, X)
# print(miX, mi1X)

# print(miX, mi1X)
# print(X)
for a in X:
    if(a <= miX):
        print(mi1X)
    else:
        print(miX)

Buggy python submission (verdict: Runtime Error):
N = int(input())
X = list(map(int, input().split()))

s_X = soreted(X)
miX = s_X[N//2]
mi1X = s_X[N//2 + 1]

for a in X:
  if(a.find(s_X)<=N//2):
    print(mi1X)
  else:
    print(miX)

Fixed submission:
# import copy

N = int(input())
X = list(map(int, input().split()))
# S_X = copy.copy(X)
S_X = sorted(X)
miX = S_X[N // 2 - 1]
mi1X = S_X[N // 2]
# print(S_X, X)
# print(miX, mi1X)

# print(miX, mi1X)
# print(X)
for a in X:
    if(a <= miX):
        print(mi1X)
    else:
        print(miX)