http://www.spoj.pl/forum/viewtopic.php?f=20&t=8264 That's all what I meant to say in here. User numerix (German?) knows ropes of Python miles far better than e.g. me.