← Home
package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	in := bufio.NewReader(os.Stdin)
	var s string
	fmt.Fscan(in, &s)

	// Build a Brainfuck program using only '-' and '.'
	ops := make([]byte, 0)
	cur := 0
	for i := 0; i < len(s); i++ {
		t := int(s[i])
		d := (cur - t + 256) % 256
		for j := 0; j < d; j++ {
			ops = append(ops, '-')
		}
		ops = append(ops, '.')
		cur = t
	}

	n := len(ops)

	// Each real row has one X in one of two columns.
	// col[i] = 0 => "X."
	// col[i] = 1 => ".X"
	col := make([]int, n)

	// Last real row must be in the first column, so that the final "XX" is "><".
	col[n-1] = 0

	// Choose columns backwards so that row i+1 produces ops[i+1].
	for i := n - 2; i >= 0; i-- {
		if ops[i+1] == '-' {
			col[i] = col[i+1]
		} else { // '.'
			col[i] = 1 - col[i+1]
		}
	}

	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()

	for i := 0; i < n; i++ {
		if col[i] == 0 {
			fmt.Fprintln(out, "X.")
		} else {
			fmt.Fprintln(out, ".X")
		}
	}
	fmt.Fprintln(out, "XX")
}