def g(p): z=[' ']*256 for a,b in p: z[b:b+len(a)+1]='*'+a return''.join(z).rstrip() import systest = sys.stdin.read() t = [(a,int(b))for a,b in map(str.split,test.split('\n'))]r = g(t)print r
Hello 0 World 8 Fizz 3 Buzz 5 PPCG 16 X 9
*He*F*Buz*Xrld *PPCG
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!