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

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.p: C = None
        self.t: A = None
        self.z: E = None
        self.u: C = None
        self.txt = txt

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

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

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

c.y = k
j.v = i
m.w = i
m.t = i
m.p = b
m.u = b
m.z = l
g.t = b
l.s = m
k.v = i
h.t = m
i.y = j
b.w = c
b.p = m
b.u = m
b.t = i
b.z = l
assert l.s.p.p.z.s.p.u.z.s.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.p: C = None
        self.t: A = None
        self.z: E = None
        self.u: C = None
        self.txt = txt

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

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

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

c.y = k
j.v = i
m.w = i
m.t = i
m.p = b
m.u = b
m.z = l
g.t = b
l.s = m
k.v = i
h.t = m
i.y = j
b.w = c
b.p = m
b.u = m
b.t = i
b.z = l
assert l.s.p.p.z.s.p.u.z.s.txt == "m"