class A:
    def __init__(self, txt: str):
        self.s: A = None
        self.z: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

g = A("g")
i = B("i")
e = C("e")
c = B("c")
h = A("h")
l = C("l")
b = A("b")
n = A("n")
a = C("a")
j = B("j")

g.s = n
g.z = e
i.o = h
i.w = e
e.w = l
c.o = h
c.w = l
h.s = g
h.z = a
l.w = e
b.s = n
b.z = a
n.s = b
n.z = e
a.w = e
j.o = g
j.w = l
assert l.w.w.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.s: A = None
        self.z: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

g = A("g")
i = B("i")
e = C("e")
c = B("c")
h = A("h")
l = C("l")
b = A("b")
n = A("n")
a = C("a")
j = B("j")

g.s = n
g.z = e
i.o = h
i.w = e
e.w = l
c.o = h
c.w = l
h.s = g
h.z = a
l.w = e
b.s = n
b.z = a
n.s = b
n.z = e
a.w = e
j.o = g
j.w = l
assert l.w.w.w.w.txt == "l"