aboutsummaryrefslogtreecommitdiff
path: root/challenge-117/abigail/python/ch-2.py
blob: c52987fee8910d2e052315b25c343c144daa1419 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/opt/local/bin/python

#
# See ../README.md
#

#
# Run as: python ch-2.py < input-file
#

import sys

def steps (x, y, path):
    if x == 0 and y == 0:
        print (path)
        return
    if x > 0:
        steps (x - 1, y,     path + "R")
        steps (x - 1, y + 1, path + "L")
    if y > 0:
        steps (x,     y - 1, path + "H")


steps (int (sys . stdin . readline ()), 0, "")