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

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

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

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

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

m = A("m")
i = B("i")
n = C("n")
d = D("d")
f = E("f")
h = C("h")

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

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

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

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

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

m = A("m")
i = B("i")
n = C("n")
d = D("d")
f = E("f")
h = C("h")

m.w = f
m.r = n
m.t = i
m.x = d
m.p = d
i.x = d
i.t = d
i.o = d
i.q = n
i.v = f
n.o = d
n.z = h
n.w = m
d.x = i
d.s = i
d.r = f
d.p = m
f.r = d
f.y = i
f.z = i
f.w = n
f.p = m
h.o = d
h.z = n
h.w = m
assert i.t.r.w.w.x.txt == "d"