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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.z: E = None
        self.t: D = None
        self.q: E = None
        self.txt = txt

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

h = A("h")
g = B("g")
n = C("n")
j = D("j")
e = E("e")
m = D("m")
l = B("l")
c = C("c")

h.t = e
g.x = m
g.p = m
n.z = j
n.o = c
j.u = g
j.z = e
j.q = e
j.t = m
e.s = g
e.u = l
m.u = l
m.z = e
m.q = e
m.t = j
l.x = j
l.p = m
c.z = m
c.o = n
assert h.t.s.p.z.u.p.u.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.z: E = None
        self.t: D = None
        self.q: E = None
        self.txt = txt

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

h = A("h")
g = B("g")
n = C("n")
j = D("j")
e = E("e")
m = D("m")
l = B("l")
c = C("c")

h.t = e
g.x = m
g.p = m
n.z = j
n.o = c
j.u = g
j.z = e
j.q = e
j.t = m
e.s = g
e.u = l
m.u = l
m.z = e
m.q = e
m.t = j
l.x = j
l.p = m
c.z = m
c.o = n
assert h.t.s.p.z.u.p.u.txt == "l"