#!/usr/bin/env python3 import re def main(): content = open('input', 'r').readlines() content = list(map(str.strip, content)) for line in content: m = re.match('^(\d+),(\d+) -> (\d+),(\d+)') x1, y1, x2, y2 = m.groups(1) print(f'going from {x1},{y2} to {x2},{y2}') if __name__ == "__main__": main()