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

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

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: D = None
        self.z: A = None
        self.y: E = None
        self.txt = txt

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

l = A("l")
d = B("d")
c = C("c")
h = D("h")
n = E("n")
f = B("f")
m = A("m")
g = D("g")
a = C("a")

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: D = None
        self.z: A = None
        self.y: E = None
        self.txt = txt

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

l = A("l")
d = B("d")
c = C("c")
h = D("h")
n = E("n")
f = B("f")
m = A("m")
g = D("g")
a = C("a")

l.y = g
l.u = a
d.t = m
d.s = n
d.v = h
c.y = m
c.w = a
c.v = h
c.r = n
h.q = l
h.z = l
h.u = g
h.y = n
n.t = c
f.t = l
f.s = n
f.v = g
m.y = h
m.u = c
g.q = m
g.z = m
g.u = h
g.y = n
a.y = m
a.w = c
a.v = g
a.r = n
assert l.u.w.v.y.t.txt == "c"