Harryxun/stf_run huggingface dataset:
s=list(input())
if len(s)==2:
    if s[0]==s[1]:
        print('1 2')
    else:
        print('-1 -1')
    exit()
for i in range(len(s)-1):
    if l[i]==l[i+1]:
        print(*[i+1,i+2])
        exit()
for i in range(len(s)-2):
    if l[i]==l[i+2]:
        print(*[i+1,i+3])
        exit()
print('-1 -1')

### FIXED CODE ###

l=list(input())
if len(l)==2:
    if l[0]==l[1]:
        print('1 2')
    else:
        print('-1 -1')
    exit()
for i in range(len(l)-1):
    if l[i]==l[i+1]:
        print(*[i+1,i+2])
        exit()
for i in range(len(l)-2):
    if l[i]==l[i+2]:
        print(*[i+1,i+3])
        exit()
print('-1 -1')
from sys import stdin
input = stdin.readline

class Unionfind():
    def __init__(self,n):
        self.n = n
        self.parent = [-1]*n
    
    def find(self,x):
        if self.parent[x] < 0:
            return x
        else:
            self.parent[x] = self.find(self.parent[x])
            return self.parent[x]
    
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        
        if x == y:
            return 0
        if self.parent[x] < self.parent[y]:
            x,y = y,x
        
        total_unite_island = self.parent[x] * self.parent[y]
        self.parent[x] += self.parent[y]
        self.parent[y] = x
        return total_unite_island

N,M = map(int, input().split())
A = [0]*M; B = [0]*M
for i in range(M):
    A[i], B[i] = map(lambda x: int(x) - 1, input().split())

uf = Unionfind(N)
inconvenience = N * (N-1) // 2
inconvenience_list = [0]*M
inconvenience_list[M-1] = inconvenience
for i in range(M-1,0,-1):
    inconvenience -= uf.union(A[i],B[i])
    inconvenience_list[i-1] = inconvenience
for i in range(M):
    print(inconvenience_list[i])

### FIXED CODE ###

from sys import stdin, setrecursionlimit
input = stdin.readline
setrecursionlimit(10**8)

class Unionfind():
    def __init__(self,n):
        self.n = n
        self.parent = [-1]*n
    
    def find(self,x):
        if self.parent[x] < 0:
            return x
        else:
            self.parent[x] = self.find(self.parent[x])
            return self.parent[x]
    
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        
        if x == y:
            return 0
        if self.parent[x] < self.parent[y]:
            x,y = y,x
        
        total_unite_island = self.parent[x] * self.parent[y]
        self.parent[x] += self.parent[y]
        self.parent[y] = x
        return total_unite_island

N,M = map(int, input().split())
A = [0]*M; B = [0]*M
for i in range(M):
    A[i], B[i] = map(lambda x: int(x) - 1, input().split())

uf = Unionfind(N)
inconvenience = N * (N-1) // 2
inconvenience_list = [0]*M
inconvenience_list[M-1] = inconvenience
for i in range(M-1,0,-1):
    inconvenience -= uf.union(A[i],B[i])
    inconvenience_list[i-1] = inconvenience
for i in range(M):
    print(inconvenience_list[i])
p=int(input())
q=int(input())
r=int(input())
if p+q<q+r and p+q<p+r:
    print(p+q)
if q+r<p+q and p+r<q+r:
    print(p+r)
else:
    print(q+r)



### FIXED CODE ###

p,q,r=map(int,input().split())
if p>=q and p>r:
    print(q+r)
if q>=r and q>p:
    print(p+r)
if r>=p and r>q:
    print(q+p)
if r==p and p==q:
    print(q+p)
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 14 22:24:31 2017

@author: Kanoh
"""
import numpy as np
N = int(raw_input())#標準入力
A = raw_input()#標準入力
A_split=A.split(" ")
A_int=np.zeros((N))

for i in range(int(N)):
    A_int[i]=int(A_split[i])

counter=0
checker=0
while 1 :
    for i in range(N):
        if(A_int[i]%2)!=1:
            A_int[i]=A_int[i]/2
        else:
            checker=1
    if(checker==1):
        break
    else:
        counter=counter+1
    
print counter

### FIXED CODE ###

#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 14 22:14:39 2017

@author: Kanoh
"""

#Placing Marbles
input_line1 = raw_input()#標準入力
total=0
counter=0
for i in range(len(input_line1)):
    if(int(input_line1[i])==1):
        counter=counter+1
        
print counter
N = int(input())
s = int(input())

red = 0
blue = 0
for _ in s:
  if _ == "B":
    blue += 1
  else:
    red += 1

if red > blue:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

N = int(input())
s = input()

red = 0
blue = 0
for _ in s:
  if _ == "B":
    blue += 1
  else:
    red += 1

if red > blue:
  print("Yes")
else:
  print("No")
n = input()
m = n.split()
for i in range(0, len(m)):
    m[i] = int(m[i])
a = m[0]
b = m[1]
m = m[2:]
p = 0
for i in range(a-b,a):
    p = p + int(m[i])
print(int(p))

### FIXED CODE ###

n = input()
m = n.split()
a = [input() for l in range(0,1)]
b = a[0].split()
for i in range(0, len(b)):
    b[i] = int(b[i])
c = sorted(b, reverse=True)
p = 0
for i in range(int(m[0]) - int(m[1]),int(m[0])):
    p = p + int(c[i])
print(p)
S = int(input())
 
if S =< 10**9:
  print(0,0,S,0,0,1)
elif S == 10*18:
  print(0,0,10**9,0,0,10**9)
  end
else:
  q,r = divmod(S,10**9)
  if r = 0:
    print(0,0,0,10**9,q,0)
  else:
    print(0,0,1,10**9,q+1,10**9-r)

### FIXED CODE ###

S = int(input())
 
if S <= 10**9:
  print(0,0,S,0,0,1)
elif S == 10*18:
  print(0,0,10**9,0,0,10**9)
  end
else:
  q,r = divmod(S,10**9)
  if r == 0:
    print(0,0,0,10**9,q,0)
  else:
    print(0,0,1,10**9,q+1,10**9-r)
N = int(input())
s = [input() for _ in range(N)]
 
import collections
sortedList = [''.join(sorted(x)) for x in s]
countNum = list(collections.Counter(sortedList).values())
 
import sys
sys.setrecursionlimit(100000000)
 
nCr = {}
def cmb(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]

count = 0
memo = [0]*10**5
for n in countNum:
    if n!=1:
        if memo[n] == 0:
            memo[n] = cmb(n, 2)
        count += memo[n]
        
print(count)

### FIXED CODE ###

N = int(input())
s = [input() for _ in range(N)]
 
import collections
sortedList = [''.join(sorted(x)) for x in s]
countNum = list(collections.Counter(sortedList).values())
 
import sys
sys.setrecursionlimit(100000000)
 
nCr = {}
def cmb(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]
  
count = 0
memo = [0]*10**6
for n in countNum:
    if n!=1:
        if memo[n] == 0:
            memo[n] = cmb(n, 2)
        count += memo[n]
        
print(count)
S = input()
if S.count(7)==0:
  print('No')
else:
  print('Yes')
  


### FIXED CODE ###

S = list(input())
if S.count('7'):
  print('Yes')
else:
  print('No')
N,K=map(int,input().split())
mod=10**9+7
A=list(map(int,input().split()))
A.sort(reverse=True)
Plus=[]
Minus=[]
Zero=[]
for i in range(N):
    if A[i]>0:
        Plus.append(A[i])
    elif A[i]<0:
        Minus.append(-A[i])
    else:
        Zero.append(A[i])
Plus.sort(reverse=True)
Minus.sort(reverse=True)
if len(Plus)==0:
    if len(Zero)==0:
        if K%2==0:
            ans=1
            for i in range(K):
                ans=ans*Minus[i]
                ans%=mod
            print(ans)
        else:
            ans=1
            for i in range(K):
                ans=ans*Minus[-i-1]
                ans%=mod
            print((-ans)%mod)
    else:
        if len(Minus)<=K:
            if K%2==0:
                ans=1
                for i in range(K):
                    ans=ans*Minus[i]
                    ans%=mod
                print(ans)
            else:
                print(0)
        else:
            print(0)
    exit()
if len(Minus)==0:
    ans=1
    for i in range(K):
        ans=ans*A[i]
        ans%=mod
    print(ans)
    exit()
if len(Zero)>N-K:
    print(0)
    exit()
if len(Zero)+K==N:
    if len(Minus)%2==0:
        ans=1
        for i in range(N):
            if A[i]!=0:
                ans=ans*abs(A[i])
                ans%=mod
        print(ans)
    else:
        print(0)
    exit()
n=len(Plus)
m=len(Minus)
'''
+:x0,...,x(n-1)
-:y0,...,y(m-1)

x0*...x(K-l-1)*y0*...y(l-1)
yl*y(l+1)/x(K-l-1)*x(K-l-2)
これはlについて単調減少
<1となるはじめてのタイミングでbreak
'''
l=0
while(l+2<=n and l+2<=K):
    if Minus[l]*Minus[l+1]<Plus[K-l-1]*Plus[K-l-2]:
        break
    l+=2
ans=1
for i in range(l):
    ans=ans*Minus[i]
    ans%=mod
for i in range(K-l):
    ans=ans*Plus[i]
    ans%=mod
print(ans)

### FIXED CODE ###

def sgn(x):
    if x>0:
        return 1
    elif x<0:
        return -1
    else:
        return 0
N,K=map(int,input().split())
A=[int(i) for i in input().split()]
mod=10**9+7
if K==N:
    ans=1
    for i in range(N):
        ans=ans*A[i]
        ans%=mod
    print(ans)
    exit()
if max(A)<0 and K%2==1:
    ans=1
    A.sort()
    for i in range(K):
        ans=ans*A[-i-1]
        ans%=mod
    print(ans)
    exit()
A.sort(key=lambda x:abs(x),reverse=True)
P=1
Pfugou=1
for i in range(K):
    P=P*A[i]
    P%=mod
    Pfugou=Pfugou*sgn(A[i])
if Pfugou!=-1:
    print(P)
    exit()
X=[]
Y=[]
for i in range(N):
    if A[i]>=0:
        X.append(A[i])
    else:
        Y.append(-A[i])
X.sort()
Y.sort()
S=[]
while(len(S)<K):
    if len(S)==K-1:
        S.append(X[-1])
        X.pop()
    elif len(X)<=1 and len(Y)<=1:
        #選んでないのが2個以下
        #len(S)<K<=N-1
        #len(S)=N-len(X)-len(Y)>=N-2
        #よってlen(S)=N-2,K=N-1
        #前述で処理済み
        #なのでここでやることはない
        pass
    elif len(X)<=1:
        S.append(Y[-1])
        S.append(Y[-2])
        Y.pop()
        Y.pop()
    elif len(Y)<=1:
        S.append(X[-1])
        S.append(X[-2])
        X.pop()
        X.pop()
    else:
        if X[-1]*X[-2]>Y[-1]*Y[-2]:
            S.append(X[-1])
            X.pop()
        else:
            S.append(Y[-1])
            S.append(Y[-2])
            Y.pop()
            Y.pop()
ans=1
for i in S:
    ans=ans*i
    ans%=mod
print(ans)
def main():
    N, M = map(int, input().split())
    for _ in range(N):
        x, y, z = map(int, input().split())
        l.append((x,y,z))
    r = 0
    l2 = [i+j+k for i, j, k in l]
    l2.sort(reverse=True)
    r = max(r, sum(l2[:M]))
    l2 = [i+j-k for i, j, k in l]
    l2.sort(reverse=True)
    r = max(r, sum(l2[:M]))
    l2 = [i-j+k for i, j, k in l]
    l2.sort(reverse=True)
    r = max(r, sum(l2[:M]))
    l2 = [i-j-k for i, j, k in l]
    l2.sort(reverse=True)
    r = max(r, sum(l2[:M]))
    l2 = [-i+j+k for i, j, k in l]
    l2.sort(reverse=True)
    r = max(r, sum(l2[:M]))
    l2 = [-i+j-k for i, j, k in l]
    l2.sort(reverse=True)
    r = max(r, sum(l2[:M]))
    l2 = [-i-j+k for i, j, k in l]
    l2.sort(reverse=True)
    r = max(r, sum(l2[:M]))
    l2 = [-i-j-k for i, j, k in l]
    l2.sort(reverse=True)
    r = max(r, sum(l2[:M]))
    return r
print(main())


### FIXED CODE ###

def main():
    N, M = map(int, input().split())
    l = []
    for _ in range(N):
        x, y, z = map(int, input().split())
        l.append((x,y,z))
    r = 0
    l2 = [i+j+k for i, j, k in l]
    l2.sort(reverse=True)
    r = max(r, sum(l2[:M]))
    l2 = [i+j-k for i, j, k in l]
    l2.sort(reverse=True)
    r = max(r, sum(l2[:M]))
    l2 = [i-j+k for i, j, k in l]
    l2.sort(reverse=True)
    r = max(r, sum(l2[:M]))
    l2 = [i-j-k for i, j, k in l]
    l2.sort(reverse=True)
    r = max(r, sum(l2[:M]))
    l2 = [-i+j+k for i, j, k in l]
    l2.sort(reverse=True)
    r = max(r, sum(l2[:M]))
    l2 = [-i+j-k for i, j, k in l]
    l2.sort(reverse=True)
    r = max(r, sum(l2[:M]))
    l2 = [-i-j+k for i, j, k in l]
    l2.sort(reverse=True)
    r = max(r, sum(l2[:M]))
    l2 = [-i-j-k for i, j, k in l]
    l2.sort(reverse=True)
    r = max(r, sum(l2[:M]))
    return r
print(main())
text = input()

def checkHitachi(text):
  if (len(text)%2 != 0): # odd length
    return 'No'
  # even length
  for i in range(0, len(text), 2):
    if !((text[i]=='h') and (text[i+1]=='i')):
      return 'No'

  return 'Yes'
 
print(checkHitachi(text))


### FIXED CODE ###

text = input()

def checkHitachi(text):
  # odd length
  if (len(text)%2 != 0): 
    return 'No'
  # even length
  for i in range(0, len(text)-1, 2):
    if (text[i:i+2]!='hi'):
      return 'No'

  return 'Yes'
 
print(checkHitachi(text))
n,x,m=map(int,input().split())
ans=0
p=0
l=[x]
if x%m==0:
  print(x)
else:
  for i in range(1,n):
    s=(l[i-1]**2)%m
    if s==0:
      p=1
      break
    if s in l:
      break
    else:
      l.append(s)
  if p==0:
    t=sum(l[1:])
    k=n//(len(l)-1)
    j=n%(len(1)-1)
    ans=x+t*k+sum(l[1:j+1])
    print(ans)
  else:
    print(sum(l))

### FIXED CODE ###

n,x,m=map(int,input().split())
order=[-1 for i in range(m)] #-1のところにはまだ対応する余りがない、余りは高々m通り
index=0 #何番目に出た余りなのかを示す
a=[] #数列
while order[x]==-1: #ループが完成するまでは
  order[x]=index #xはindex番目の余り
  a.append(x)
  x=(x**2)%m
  index+=1
tmp=sum(a[order[x]:index]) #1ループの和、xがループの始点の余り
t=index-order[x] #1ループの長さ
if n-1<order[x]: #ループが完成しない場合
  print(sum(a[:n]))
else:
  sum1=sum(a[:order[x]]) #ループの前の和
  x1=n-order[x] #ループ部分の長さ
  n1=x1//t #ループの回数
  n2=x1%t
  print(sum1+n1*tmp+sum(a[order[x]:order[x]+n2]))
import sys
from collections import defaultdict
dic1 = defaultdict(int)
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0
mod = 10**9+7
def pow(n,p,mod=10**9+7): #繰り返し二乗法(nのp乗)
    res = 1
    while p > 0:
        if p % 2 == 0:
            n = n ** 2 % mod
            p //= 2
        else:
            res = res * n % mod
            p -= 1
    return res % mod
def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)
def lcm(a,b):
    return (a//gcd(a,b)*b)
n = int(readline())
#dic1
#[正負,比率1(小),比率2(大)]
for i in range(n):
    a,b= map(int,readline().split())
    plamai = 1 if a*b > 0 else 0
    if a < 0:a = -a
    if b < 0:b = -b
    res = gcd(a,b)
    if res == 0:
        zero += 1
        continue
    dic1[str(plamai)+" "+str(a//res)+" "+str(b//res)] += 1

ans = 1
dic2 = dict()
for i in dic1.keys():
    res = 0
    if not i in dic2:
        a = dic1[i]
        g,d,e = i.split()
        if g == "1":
            res2 = "0"+" "+e+" "+d
        else:
            res2 = "1"+" "+e+" "+d
        if res2 in dic1:
            b = dic1[res2]
        else:b = 0
        if a > 0:
            res += pow(2,a)
        if b > 0:
            res += pow(2,b)
        if a != 0 and b != 0:
            res -= 1
        ans *= res
        ans %= mod
        dic2[res2] = 1
if not zero:
    print(ans-1)
else:
    print(ans+pow(2,zero)-2)

### FIXED CODE ###

import sys
from collections import defaultdict
dic1 = defaultdict(int)
dic2 = defaultdict(int)
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0
mod = 10**9+7
def pow(n,p,mod=10**9+7): #繰り返し二乗法(nのp乗)
    res = 1
    while p > 0:
        if p % 2 == 0:
            n = n ** 2 % mod
            p //= 2
        else:
            res = res * n % mod
            p -= 1
    return res % mod
def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)
def lcm(a,b):
    return (a//gcd(a,b)*b)
def to_standard_form(a, b):
    if a == 0:
        return (0, 1)
    g = gcd(a, b)
    a //= g
    b //= g
    if a < 0:
        return (-a, -b)
    return (a, b)
n = int(readline())
zero = 0
for i in range(n):
    a,b= map(int,readline().split())
    if a == b == 0:
        zero += 1
        continue
    plamai = 1 if a*b > 0 else 0
    a,b = to_standard_form(a,b)
    if b <= 0:
        dic2[(a,b)] += 1
    else:
        dic1[(b,-a)] += 1
        dic2[(b,-a)] += 0

ans = zero
k = 1
for key,cnt in dic2.items():
    cnt2 = dic1[key]
    x = pow(2,cnt)+pow(2,cnt2)
    k = k*(x-1)%mod
print((ans+k-1)%mod)
#!/usr/bin/env python3



def solv(x, y, z, k, a, b, c):
    a = sorted(a, reverse=True)
    b = sorted(b, reverse=True)
    c = sorted(c, reverse=True)

    m = max(a[0] - a[-1], b[0] - b[-1], c[0] - c[-1])

    while True:
        aa = list(filter(lambda v: v > a[0] - m, a))
        bb = list(filter(lambda v: v > b[0] - m, b))
        cc = list(filter(lambda v: v > c[0] - m, c))

        if len(aa) * len(bb) * len(cc) < 10000:
            break

        m = m * 0.8

    aa = a
    bb = b
    cc = c

    all = []
    for ai in a:
        for bi in b:
            for ci in c:
                all.append(ai+bi+ci)

    all = sorted(all, reverse=True)

    return all[:k]


if __name__ == '__main__':

    x, y, z, k = map(int, input().split())
    a = map(int, input().split())
    b = map(int, input().split())
    c = map(int, input().split())

    ans = solv(x, y, z, k, a, b, c)

    for ans_i in ans:
        print(ans_i)


### FIXED CODE ###

#!/usr/bin/env python3


def solv(a, b, c, d, e, k):
    ants = [a, b, c, d, e]
    for i in range(1, len(ants)):
        for j in range(i):
            if abs(ants[i] - ants[j]) > k:
                return ':('
    return 'Yay!'


if __name__ == '__main__':

    a = int(input())
    b = int(input())
    c = int(input())
    d = int(input())
    e = int(input())
    k = int(input())

    ans = solv(a, b, c, d, e, k)

    print(ans)
import math
H, N = list(map(int, input().split()))

AB = [list(map(int, input().split())) for _ in range(N)]

dp = [math.inf] *(H+1)
dp[H] = 0
for a,b in AB:
    for i in range(H,-1,-1):
        if i <= H - a:
            dp[i] = min(dp[i], dp[i+a] + b)
        dp[0] = min(dp[0], min(dp[:a+1]) + b) # if hp is not just 0

print(dp[0])

### FIXED CODE ###

import math
H, N = list(map(int, input().split()))
 
AB = [list(map(int, input().split())) for _ in range(N)]
 
dp = [float('inf')] *(H+1)
dp[H] = 0
for a,b in AB:
    for i in range(H,-1,-1):
        if i <= H - a:
            dp[i] = min(dp[i], dp[i+a] + b)
    dp[0] = min(dp[0], min(dp[:a+1]) + b) # if hp is not just 0
print(dp[0])
H,W,K = map(int,input().split())
Room = []
for i in range(H):
  temp = str(input())
  temp = list(temp)
  for j in range(W):
    if temp[j] == "S":
      sx = i;sy =j
  Room.append(temp)
#print(sx,sy)
L = set([])
def dfs(x,y,stp):
  if x<0 or x>= H or y<0 or y>= W:
    print(1)
    exit()
  if Room[x][y] == "#":
    return
  if stp <= K:
    L.add((x,y))
    if stp == K:
      return
  stp +=1
  dfs(x+1,y,stp)
  dfs(x-1,y,stp)
  dfs(x,y+1,stp)
  dfs(x,y-1,stp)

dfs(sx,sy,0)
INF = float("inf")
ans = INF

for t in L:
  x,y = t[0],t[1]
  nokori = min(x,H-x,y,W-y)
  step = (nokori+K-1)//K + 1 #1は最初のステップ
  ans = min(ans,step)
print(ans)
        
        
        
              

### FIXED CODE ###

import sys
sys.setrecursionlimit(500000) #これがないと再帰の回数オーバーでエラー出る。
from collections import deque
INF = float("inf")
H,W,K = map(int,input().split())
Room = []
for i in range(H):
  temp = str(input())
  temp = list(temp)
  for j in range(W):
    if temp[j] == "S":
      sx = i;sy =j
  Room.append(temp)
#print(sx,sy)
d = [(1,0),(-1,0),(0,1),(0,-1)]

R = [[INF]*W for _ in range(H)]
R[sx][sy] = 0
reach = set([])
reach.add((sx,sy))
Q = deque([[sx,sy]])
while Q:
  x,y = Q.popleft()
  if x==0 or x==H-1 or y==0 or y==W-1:
    print(1)
    exit()
  if R[x][y] == K:
    #L.add((x,y))
    #if stp == K:
    continue
  #stp +=1
  for i in range(4):
    nx = x+d[i][0]
    ny = y+d[i][1]
    #print(nx,ny)
    if nx<0 or nx>=H or ny<0 or ny>= W or Room[nx][ny] == "#" or R[nx][ny] != INF:
      continue
    reach.add((nx,ny))
    R[nx][ny] = R[x][y] + 1
    Q.append([nx, ny])
    #print(Q)

ans = INF

for t in reach:
  x,y = t[0],t[1]
  nokori = min(x,H-1-x,y,W-1-y)
  step = (nokori+K-1)//K + 1 #1は最初のステップ
  ans = min(ans,step)
print(ans)
# AGC033C

import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


from collections import defaultdict
n = int(input())
ns = defaultdict(set)
for _ in range(n-1):
    u,v = map(int, input().split())
    ns[u-1].add(v-1)
    ns[v-1].add(u-1)

def bfs(start):
    from queue import deque
    q = deque([start])
    seen = [None] * n
    seen[start] = 0
    dd = 0
    target = None
    while q:
        u = q.pop()
        d = seen[u]
        if d>dd:
            dd = d
            target = u
        for v in ns[u]:
            if seen[v] is None:
                seen[v] = d + 1
                q.appendleft(v)
    return target, dd
target, tmp = bfs(0)
_, d = bfs(target)
if (d-1)%3!=0:
    print("First")
else:
    print("Second")

### FIXED CODE ###

# AGC033C

import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


from collections import defaultdict
n = int(input())
ns = defaultdict(set)
for _ in range(n-1):
    u,v = map(int, input().split())
    ns[u-1].add(v-1)
    ns[v-1].add(u-1)

def bfs(start):
    from queue import deque
    q = deque([start])
    seen = [None] * n
    seen[start] = 0
    dd = 0
    target = start
    while q:
        u = q.pop()
        d = seen[u]
        if d>dd:
            dd = d
            target = u
        for v in ns[u]:
            if seen[v] is None:
                seen[v] = d + 1
                q.appendleft(v)
    return target, dd
target, tmp = bfs(0)
_, d = bfs(target)
if (d-1)%3!=0:
    print("First")
else:
    print("Second")
def merge(A, left, mid, right):
    global cnt
    inf = 50000001
    n1, n2 = mid - left, right - mid
    L, R = A[left:left+n1]+[inf], A[mid:mid+n2]+[inf]
    i = j = 0
    for k in range(left, right):
        if L[i] <= R[j]:
            A[k] = L[i]
            i += 1
        else:
            A[k] = R[j]
            j += 1
        cnt += 1

def mergeSort(A, left, right):
    if left+1 < right:
        mid = (left + right) // 2
        mergeSort(A, left, mid)
        mergeSort(A, mid, right)
        merge(A, left, mid, right)

cnt = 0
n = int(input())
A = list(map(int, input().split()))
mergeSort(A, 0, n)
print(*A)
print(cnt)

### FIXED CODE ###

def merge(A, left, mid, right):
    global cnt
    inf = 100000000001
    n1, n2 = mid - left, right - mid
    L, R = A[left:left+n1]+[inf], A[mid:mid+n2]+[inf]
    i = j = 0
    for k in range(left, right):
        if L[i] <= R[j]:
            A[k] = L[i]
            i += 1
        else:
            A[k] = R[j]
            j += 1
        cnt += 1

def mergeSort(A, left, right):
    if left+1 < right:
        mid = (left + right) // 2
        mergeSort(A, left, mid)
        mergeSort(A, mid, right)
        merge(A, left, mid, right)

cnt = 0
n = int(input())
A = list(map(int, input().strip().split()))
mergeSort(A, 0, n)
print(*A)
print(cnt)
import numpy as np

N = int(input())
A = np.array(list(map(int,input().split())))
L = [0]*(N+2)
L = np.array(L)

for i in A:
    L[i] +=1

LL  = np.multiply(L,L-1)/2

gros = int(sum(LL))

for k in A:
    print(gros +1 - L[k])


### FIXED CODE ###

import numpy as np

N = int(input())
A = np.array(list(map(int,input().split())))
L = [0]*(N+2)
L = np.array(L)

for i in A:
    L[i] +=1

LL  = np.multiply(L,L-1)/2

gros = int(sum(LL))

for k in A:
    print(gros +1 - L[k])
import collections
import math
import re
import numpy


def ai():return input()#s
def a():return int(input())#a,n or k
def ma():return map(int, input().split())#a,b,c,d or n,k
def ms():return map(str, input().split())#,a,b,c,d
def lma():return list(map(int, input().split()))#x or y
def lms():return list(map(str, input().split()))#x or y
k= []
l = []
f = 0
s=0
c=0
e =1
def say(i):return print("Yes" if i == 0 else "No")
def Say(i):return print("YES" if i == 0 else "NO")
#def rep(i):return for i in range()
a = a()
x = lma()
l = set(x)
m=1
tn = 0
for i in l:
    if i- tn==1:
        ta = tb
        tb = tc
        tc = x.count(i+1)
    else:
        ta = x.count(i-1)
        tb = x.count(i)
        tc = x.count(i+1)
    t = ta+tb+tc
    m=max(m,t)
    tn = i
print(m)






### FIXED CODE ###

def abc072_c():
    from collections import Counter
 
    _ = int(input())
    a = list(map(int, input().split()))
    a_ex = []
    for num in a:
        a_ex.append(num)
        a_ex.append(num-1)
        a_ex.append(num+1)
 
    print(max(Counter(a_ex).values()))
 
 
abc072_c()
n=int(input())
i=1
while 2**i<=n:
    s=2**i
    i+=1
print(s)


### FIXED CODE ###

n=int(input())
i=0
while 2**i<=n:
    s=2**i
    i+=1
print(s)