N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
ave_a = sum(A)/N
ave_b = sum(B)/N
S_A = sum([abs(A[i]-ave_a) for i in range(N)])
S_B = sum([abs(B[i]-ave_b) for i in range(N)])
if S_A > S_B:
print("B")
elif S_A < S_B:
print("A")
else:
print("same")
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
ave_A = sum(A)/N
ave_B = sum(B)/N
S_A = sum([abs(A[i]-ave_A)**2 for i in range(N)])
S_B = sum([abs(B[i]-ave_B)**2 for i in range(N)])
if S_A > S_B:
print("B")
elif S_B > S_A:
print("A")
else:
print("same")
<div></details>
<details><summary>データの散らばり 2-2 (標準偏差)</summary><div>
<div></details>
<details><summary>平均値をずらす</summary><div>
N = int(input())
A = list(map(int,input().split()))
print(*[A[i]-sum(A)/N for i in range(N)])
N = int(input())
A = list(map(int,input().split()))
B = [A[i]-sum(A)/N for i in range(N)]
S_A = [(A[i]-sum(A)/N)**2 for i in range(N)]
S_B = [(B[i]-0)**2 for i in range(N)]
print(sum(S_B)/sum(S_A))
N,K = map(int,input().split())
H = list(map(int,input().split()))
print(*[H[i]*K for i in range(N)])
N = int(input())
print(sum(list(map(int,input().split())))/N)