class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

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

g = A("g")
c = B("c")
m = C("m")
i = A("i")
e = A("e")
d = C("d")
h = C("h")
n = C("n")

g.u = c
c.t = e
m.o = c
m.w = n
i.u = c
e.u = c
d.o = c
d.w = n
h.o = c
h.w = m
n.o = c
n.w = m
assert h.o.t.u.t.u.t.u.t.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

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

g = A("g")
c = B("c")
m = C("m")
i = A("i")
e = A("e")
d = C("d")
h = C("h")
n = C("n")

g.u = c
c.t = e
m.o = c
m.w = n
i.u = c
e.u = c
d.o = c
d.w = n
h.o = c
h.w = m
n.o = c
n.w = m
assert h.o.t.u.t.u.t.u.t.txt == "e"