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