http://codeforces.com/problemset/problem/373/A