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

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

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

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

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

m = A("m")
b = B("b")
d = C("d")
g = D("g")
l = E("l")
n = B("n")

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

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

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

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

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

m = A("m")
b = B("b")
d = C("d")
g = D("g")
l = E("l")
n = B("n")

m.x = d
m.t = g
b.t = n
b.o = n
b.z = n
b.y = l
b.r = m
d.t = g
d.v = g
d.u = l
g.y = b
l.w = b
l.x = d
n.t = b
n.o = b
n.z = b
n.y = l
n.r = m
assert n.o.r.x.u.w.r.txt == "m"