codeforces pset3

a and b