s = '' for i in xrange(1, 1000): s += '{{#if:{{{%d|}}}|{{ {{#titleparts:{{{arg}}}||6}}|{{#titleparts:{{{arg}}}|5}}|{{{%d}}}}}}}' % (i,i) print s