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

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

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

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

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

e = A("e")
i = B("i")
b = C("b")
j = D("j")
h = E("h")
l = D("l")
f = A("f")

e.r = i
e.t = l
i.o = e
i.u = e
i.p = l
i.z = b
b.s = i
b.w = j
j.x = h
h.r = l
h.s = j
l.x = h
f.r = i
f.t = l
assert l.x.r.x.s.x.s.x.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: D = None
        self.txt = txt

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

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

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

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

e = A("e")
i = B("i")
b = C("b")
j = D("j")
h = E("h")
l = D("l")
f = A("f")

e.r = i
e.t = l
i.o = e
i.u = e
i.p = l
i.z = b
b.s = i
b.w = j
j.x = h
h.r = l
h.s = j
l.x = h
f.r = i
f.t = l
assert l.x.r.x.s.x.s.x.txt == "h"