text = " ++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>."
c_code = "#include <stdio.h>\n#include <string.h>\nvoid main(){\nint i = 0;\nchar arr[30000];\nmemset(arr, 0, sizeof(arr));\n"

for i = 1, #text do
	s=text:sub(i,i)
	c_code=c_code.."\n"
	if s == '>' then c_code=c_code.."i++;" end
	if s == '<' then c_code=c_code.."i--;" end
	if s == '+' then c_code=c_code.."arr[i]++;" end
	if s == '-' then c_code=c_code.."arr[i]--;" end

	if s == '.' then c_code=c_code.."putchar(arr[i]);" end
	if s == ',' then c_code=c_code.."arr[i] = getchar();" end
	if s == '[' then c_code=c_code.."while(arr[i]){" end
	if s == ']' then c_code=c_code.."}" end
	
end
c_code = c_code.."}"

print(c_code)