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

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

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

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

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

e = A("e")
a = B("a")
l = C("l")
g = D("g")
d = E("d")
b = D("b")
f = A("f")
j = B("j")
c = B("c")
h = B("h")

e.z = c
e.u = d
e.t = l
a.p = d
a.t = d
l.r = c
g.u = d
d.s = b
d.w = b
d.o = c
d.y = l
b.u = d
f.z = h
f.u = d
f.t = l
j.p = d
j.t = d
c.p = d
c.t = d
h.p = d
h.t = d
assert h.t.o.p.y.r.t.y.r.p.y.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: E = None
        self.t: C = None
        self.txt = txt

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

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

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

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

e = A("e")
a = B("a")
l = C("l")
g = D("g")
d = E("d")
b = D("b")
f = A("f")
j = B("j")
c = B("c")
h = B("h")

e.z = c
e.u = d
e.t = l
a.p = d
a.t = d
l.r = c
g.u = d
d.s = b
d.w = b
d.o = c
d.y = l
b.u = d
f.z = h
f.u = d
f.t = l
j.p = d
j.t = d
c.p = d
c.t = d
h.p = d
h.t = d
assert h.t.o.p.y.r.t.y.r.p.y.txt == "l"