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

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

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

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: F = None
        self.s: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.w: D = None
        self.u: F = None
        self.v: D = None
        self.txt = txt

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

a = A("a")
d = B("d")
m = C("m")
l = D("l")
e = E("e")
n = F("n")
h = F("h")

a.w = e
a.y = e
a.t = l
d.t = n
d.s = n
d.x = m
d.y = l
m.y = h
l.w = n
l.s = n
l.p = h
e.z = n
e.w = l
e.v = l
e.u = h
n.z = l
n.x = h
h.z = l
h.x = n
assert l.p.x.x.z.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: D = None
        self.y: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: F = None
        self.s: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.w: D = None
        self.u: F = None
        self.v: D = None
        self.txt = txt

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

a = A("a")
d = B("d")
m = C("m")
l = D("l")
e = E("e")
n = F("n")
h = F("h")

a.w = e
a.y = e
a.t = l
d.t = n
d.s = n
d.x = m
d.y = l
m.y = h
l.w = n
l.s = n
l.p = h
e.z = n
e.w = l
e.v = l
e.u = h
n.z = l
n.x = h
h.z = l
h.x = n
assert l.p.x.x.z.txt == "l"