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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: E = None
        self.r: E = None
        self.v: E = None
        self.w: C = None
        self.txt = txt

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

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

m.x = a
m.y = a
l.u = h
a.v = l
a.q = m
f.s = h
f.y = h
f.r = d
f.v = d
f.w = a
d.t = m
d.y = f
d.r = l
d.s = i
d.x = a
h.t = m
h.y = f
h.r = l
h.s = i
h.x = a
i.x = a
i.y = a
assert l.u.r.u.t.y.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: E = None
        self.r: E = None
        self.v: E = None
        self.w: C = None
        self.txt = txt

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

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

m.x = a
m.y = a
l.u = h
a.v = l
a.q = m
f.s = h
f.y = h
f.r = d
f.v = d
f.w = a
d.t = m
d.y = f
d.r = l
d.s = i
d.x = a
h.t = m
h.y = f
h.r = l
h.s = i
h.x = a
i.x = a
i.y = a
assert l.u.r.u.t.y.txt == "a"