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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: E = None
        self.s: D = None
        self.txt = txt

l = A("l")
d = B("d")
k = C("k")
b = D("b")
m = E("m")
e = B("e")
j = A("j")
g = C("g")
h = E("h")

l.u = m
l.v = d
l.t = b
d.s = l
d.z = l
d.x = b
k.x = d
k.q = e
b.t = g
b.p = l
m.z = h
m.s = b
e.s = l
e.x = b
e.z = j
j.u = h
j.v = d
j.t = b
g.x = d
g.q = e
h.z = m
h.s = b
assert m.z.z.s.t.x.s.v.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.v: B = None
        self.t: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: E = None
        self.s: D = None
        self.txt = txt

l = A("l")
d = B("d")
k = C("k")
b = D("b")
m = E("m")
e = B("e")
j = A("j")
g = C("g")
h = E("h")

l.u = m
l.v = d
l.t = b
d.s = l
d.z = l
d.x = b
k.x = d
k.q = e
b.t = g
b.p = l
m.z = h
m.s = b
e.s = l
e.x = b
e.z = j
j.u = h
j.v = d
j.t = b
g.x = d
g.q = e
h.z = m
h.s = b
assert m.z.z.s.t.x.s.v.txt == "d"