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

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

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

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: E = None
        self.w: E = None
        self.txt = txt

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

l = A("l")
i = B("i")
c = C("c")
j = D("j")
b = E("b")
m = A("m")
f = A("f")

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: E = None
        self.w: E = None
        self.txt = txt

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

l = A("l")
i = B("i")
c = C("c")
j = D("j")
b = E("b")
m = A("m")
f = A("f")

l.r = b
l.x = i
l.o = m
l.t = j
l.z = j
i.p = c
i.y = j
i.z = m
c.s = f
c.u = j
c.o = m
c.w = b
j.p = b
j.z = b
j.w = b
b.w = c
b.r = c
b.s = i
b.u = i
b.x = j
m.r = b
m.x = i
m.o = l
m.t = j
m.z = j
f.r = b
f.x = i
f.o = l
f.t = j
f.z = j
assert b.x.p.x.txt == "j"