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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: C = None
        self.s: C = None
        self.u: D = None
        self.y: A = None
        self.txt = txt

m = A("m")
a = B("a")
b = C("b")
f = D("f")
l = E("l")
j = A("j")
k = D("k")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: C = None
        self.s: C = None
        self.u: D = None
        self.y: A = None
        self.txt = txt

m = A("m")
a = B("a")
b = C("b")
f = D("f")
l = E("l")
j = A("j")
k = D("k")

m.p = a
m.z = f
m.w = k
m.x = j
a.t = b
a.x = b
a.q = l
a.v = l
a.p = l
b.o = k
b.v = k
b.p = k
b.s = a
f.p = k
f.o = m
l.p = b
l.t = b
l.s = b
l.u = f
l.y = j
j.p = a
j.z = f
j.w = k
j.x = m
k.p = f
k.o = j
assert a.t.o.o.txt == "j"