Buggy python submission (verdict: Runtime Error):
k=int(input())
a=[int(i) for i in input().split()]
chk=2
if a[-1]!=2:
    print(-1)
    exit()
else:
    for i in range(k-1,0,-1):
        if a[i-1]>=a[i]*2:
            print(-1)
            exit()
    print(chk[2])

Fixed submission:
k=int(input())
a=[int(i) for i in input().split()]
l=2
r=3
for i in range(k-1,-1,-1):
    l=(l+a[i]-1)//a[i]*a[i]
    r=(r+a[i]-1)//a[i]*a[i]
if l==r:
    print(-1)
else:
    print(l,r-1)

Buggy python submission (verdict: Runtime Error):
k=int(input())
a=[int(i) for i in input().split()]
chk=2
if a[-1]!=2:
    print(-1)
    exit()
else:
    for i in range(n-1,0,-1):
        if a[i-1]>=a[i]*2:
            print(-1)
            exit()
    print(chk[2])

Fixed submission:
k=int(input())
a=[int(i) for i in input().split()]
l=2
r=3
for i in range(k-1,-1,-1):
    l=(l+a[i]-1)//a[i]*a[i]
    r=(r+a[i]-1)//a[i]*a[i]
if l==r:
    print(-1)
else:
    print(l,r-1)

Buggy python submission (verdict: Runtime Error):
k=int(input())
a=[int(i) for i in input().split()]
chk=2
if a[-1]!=2:
    print(-1)
    exit()
else:
    print(chk[2])


Fixed submission:
k=int(input())
a=[int(i) for i in input().split()]
l=2
r=3
for i in range(k-1,-1,-1):
    l=(l+a[i]-1)//a[i]*a[i]
    r=(r+a[i]-1)//a[i]*a[i]
if l==r:
    print(-1)
else:
    print(l,r-1)

Buggy python submission (verdict: Runtime Error):
k=int(input())
a=[int0(i) for i in input().split()]
ans=0
chk=2
if a[-1]!=2:
  print(-1)
  exit()
elif k==1 and a[0]==2:
  print(2,3)
  exit()
for i in range(k-1,1,-1):
  if a[i]>=chk*2:
    print(-1)
    exit()
    
  if a[i]<chk:
    a[i]=(a[i]+chk)//a[i]*a[i]
  chk=a[i]
print(a[0],(a[0]+a[1]*2)//a[0]*a[0]-1)


Fixed submission:
k=int(input())
a=[int(i) for i in input().split()]
l=2
r=3
for i in range(k-1,-1,-1):
    l=(l+a[i]-1)//a[i]*a[i]
    r=(r+a[i]-1)//a[i]*a[i]
if l==r:
    print(-1)
else:
    print(l,r-1)

Buggy python submission (verdict: Runtime Error):
k=int(input())
a=[int(i) for i in input().split()]
ans=0
chk=2
if a[-1]!=2:
  print(-1)
  exit()
elif k==1 and a[0]==2:
  print(2,2)
  exit()
for i in range(n-1,-1,-1):
  if a[i]>=chk*2:
    print(-1)
    exit()
  if a[i]<chk:
    a[i]=(a[i]+chk)//a[i]*a[i]
    chk=a[i]
print(a[0],a[1]*2-1)
    


Fixed submission:
k=int(input())
a=[int(i) for i in input().split()]
l=2
r=3
for i in range(k-1,-1,-1):
    l=(l+a[i]-1)//a[i]*a[i]
    r=(r+a[i]-1)//a[i]*a[i]
if l==r:
    print(-1)
else:
    print(l,r-1)

Buggy python submission (verdict: Runtime Error):
k=int(input())
a=[int(i) for i in input().split()]
ans=0
chk=2
if a[-1]!=2:
    print(-1)
    exit()
elif k==1 and a[0]==2:
  print(2,2)
  exit()
for i in range(n-1,-1,-1):
  if a[i]>=chk*2:
    print(-1)
    exit()
  if a[i]<chk:
    a[i]=(a[i]+chk)//a[i]*a[i]
    chk=a[i]
print(a[0],a[1]*2-1)
    

Fixed submission:
k=int(input())
a=[int(i) for i in input().split()]
l=2
r=3
for i in range(k-1,-1,-1):
    l=(l+a[i]-1)//a[i]*a[i]
    r=(r+a[i]-1)//a[i]*a[i]
if l==r:
    print(-1)
else:
    print(l,r-1)

Buggy python submission (verdict: Runtime Error):
k=int(input())
a=[int(i) for i in input().split()]
ans=0
chk=0
if a[-1]!=2:
    print(-1)
else:
    print(ans[1])


Fixed submission:
k=int(input())
a=[int(i) for i in input().split()]
l=2
r=3
for i in range(k-1,-1,-1):
    l=(l+a[i]-1)//a[i]*a[i]
    r=(r+a[i]-1)//a[i]*a[i]
if l==r:
    print(-1)
else:
    print(l,r-1)