class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: B = None
        self.x: B = None
        self.s: E = None
        self.txt = txt

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

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

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

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

m = A("m")
i = B("i")
a = C("a")
d = D("d")
b = E("b")
k = E("k")

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

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

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

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

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

m = A("m")
i = B("i")
a = C("a")
d = D("d")
b = E("b")
k = E("k")

m.w = d
m.t = i
m.x = i
m.s = b
i.t = d
i.r = a
i.o = m
a.q = i
a.p = i
a.z = k
a.o = b
a.v = d
d.r = i
b.o = k
b.r = k
b.y = a
b.t = m
b.w = d
k.o = b
k.r = b
k.y = a
k.t = m
k.w = d
assert a.o.o.r.txt == "b"