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