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

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

class C:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: D = None
        self.p: B = None
        self.z: B = None
        self.txt = txt

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

m = A("m")
k = B("k")
c = C("c")
a = D("a")
e = B("e")
l = C("l")
b = C("b")
h = B("h")

m.w = a
m.y = h
m.p = k
k.t = e
k.x = e
c.y = b
c.w = a
c.p = k
c.z = h
a.o = m
a.y = l
a.u = h
e.t = k
e.x = k
l.y = c
l.w = a
l.p = k
l.z = h
b.y = l
b.w = a
b.p = k
b.z = e
h.t = k
h.x = k
assert b.w.u.t.t.t.x.x.t.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: B = None
        self.p: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: D = None
        self.p: B = None
        self.z: B = None
        self.txt = txt

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

m = A("m")
k = B("k")
c = C("c")
a = D("a")
e = B("e")
l = C("l")
b = C("b")
h = B("h")

m.w = a
m.y = h
m.p = k
k.t = e
k.x = e
c.y = b
c.w = a
c.p = k
c.z = h
a.o = m
a.y = l
a.u = h
e.t = k
e.x = k
l.y = c
l.w = a
l.p = k
l.z = h
b.y = l
b.w = a
b.p = k
b.z = e
h.t = k
h.x = k
assert b.w.u.t.t.t.x.x.t.txt == "e"