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

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

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

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

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

b = A("b")
e = B("e")
l = C("l")
f = D("f")
g = E("g")
d = D("d")

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

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

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

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

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

b = A("b")
e = B("e")
l = C("l")
f = D("f")
g = E("g")
d = D("d")

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