#!/opt/pwn.college/python

import pathlib
import random

import jinja2

with open("/flag") as f:
    random.seed(f.read())

init_path = pathlib.Path(__file__)
planets_path = (pathlib.Path(__file__).parent / "planets.txt")
launch_path = (pathlib.Path(__file__).parent / "launch")
launch_template_path = (pathlib.Path(__file__).parent / "launch.j2")

planet = random.choice(planets_path.read_text().strip().splitlines())

template = jinja2.Template(launch_template_path)
launch_path.write_text(template.render(planet=planet))

launch_template_path.unlink()
planets_path.unlink()
init_path.unlink()
