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

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

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

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

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

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

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

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

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

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

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

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

l.r = f
l.z = f
l.w = b
l.v = d
b.x = f
b.p = l
b.q = c
b.t = e
f.y = l
f.w = a
c.o = l
c.q = e
a.u = b
a.p = e
a.o = e
a.r = l
d.r = f
d.z = f
d.w = b
d.v = l
e.x = f
e.p = l
e.q = c
e.t = b
assert e.x.y.w.txt == "b"