TEMPLATE FUNCTIONS:
stdin = lambda type_ = "int", sep = " ": list(map(eval(type_), raw_input().split(sep)))
"""
>>> stdin()
1 2 3 4
>>>[1, 2, 3, 4]
"""
joint = lambda sep = " ", *args: sep.join(str(i) if type(i) != list else sep.join(map(str, i)) for i in args)
"""
>>> joint(" ", [1, 2])
'1 2'
>>> joint(" ", [1, 2], [2, 3])
'1 2 2 3'
"""
def iters(): return map(int(raw_input()))
PROBLEMS:
==================
http://codeforces.me/contest/988/problem/B
n = int(input())
a = sorted((input() for _ in range(n)), key=lambda x: len(x))
v = all(a[i] in a[i+1] for i in range(n-1))
print('YES\n'+"\n".join(a) if v else 'NO')
==================
http://codeforces.me/contest/994/problem/A
R = lambda: (int, input().split())
n, a, b = R(), R(), R()
print(' '.join(map(str, (x for x in a if x in b))))
==================
http://codeforces.me/contest/994/problem/B
R = lambda: map(int, input().split())
n, k = R(),
v, t = [], [0]*n
for p, c, i in sorted(zip(R(), R(), range(n))):
t[i] = sum(v)+c
v += [c]
v = sorted(v)[::-1]
if len(v) > k:
v.pop()
print(' '.join(map(str, t)))
==================
http://codeforces.me/contest/754/problem/A
n, a = int(input()), list(map(int, input().split()))
x = next((i for i, ai in enumerate(a) if ai), None) # find index of first non-zero elements in a
if x is None:
print('NO')
elif sum(a):
print('YES', 1, '1 {}'.format(n), sep='\n')
else:
print('YES', 2, '1 {}'.format(x + 1), '{} {}'.format(x + 2, n), sep='\n')
==================
http://codeforces.me/contest/996/problem/B
import math
n, a, m, res = int(input()), [*(map(int,input().split()))], 10e9,-1
k = [ math.ceil((ai-i)/n) for i,ai in enumerate(a) ]
print(k.index(min(k))+1)
==================
https://codeforces.me/contest/1082/problem/B
_, string = raw_input(), raw_input()
start, end, res = 0, 0, 0
for char in string:
if char == "G": start += 1
else: end, start = start, 0
res = max(res, start + end + 1)
print min(res, string.count("G"))
==================
https://codeforces.me/contest/1082/problem/B
x = int(raw_input())
print " ".join(map(str, [x, x])) if x != 1 else -1
==================
https://codeforces.me/contest/1082/problem/B
n, k = map(int, raw_input().split())
numbers = map(int, raw_input().split())
res, numbers = [], [0] + sorted(list(set(numbers)))
for i in xrange(min(len(numbers) - 1, k)): print (numbers[i + 1] - numbers[i])
for _ in xrange(k - len(numbers) + 1): print 0
==================
https://codeforces.me/contest/1092/problem/A
for _ in iters():
n, k = stdin()
print joint('', ([chr(ord('a') + i%k) for i in xrange(n)]))
==================
*find more here https://github.com/SolbiatiAlessandro/pyComPro