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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: E = None
        self.w: A = None
        self.x: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: D = None
        self.z: D = None
        self.v: B = None
        self.q: D = None
        self.txt = txt

m = A("m")
d = B("d")
h = C("h")
k = D("k")
c = E("c")
l = E("l")

m.o = d
m.r = d
m.y = k
m.p = c
m.u = h
d.v = h
d.o = c
d.w = m
d.x = k
h.t = k
h.s = k
h.u = c
h.y = l
k.x = d
k.r = h
k.s = h
k.o = l
c.u = d
c.v = d
c.w = k
c.z = k
c.q = k
l.u = d
l.v = d
l.w = k
l.z = k
l.q = k
assert d.o.u.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.r: B = None
        self.y: D = None
        self.p: E = None
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: E = None
        self.w: A = None
        self.x: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: D = None
        self.z: D = None
        self.v: B = None
        self.q: D = None
        self.txt = txt

m = A("m")
d = B("d")
h = C("h")
k = D("k")
c = E("c")
l = E("l")

m.o = d
m.r = d
m.y = k
m.p = c
m.u = h
d.v = h
d.o = c
d.w = m
d.x = k
h.t = k
h.s = k
h.u = c
h.y = l
k.x = d
k.r = h
k.s = h
k.o = l
c.u = d
c.v = d
c.w = k
c.z = k
c.q = k
l.u = d
l.v = d
l.w = k
l.z = k
l.q = k
assert d.o.u.o.txt == "c"