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

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: C = None
        self.txt = txt

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

l = A("l")
c = B("c")
d = C("d")
h = D("h")
e = A("e")
i = D("i")
f = C("f")
b = A("b")

l.s = e
l.w = e
l.u = i
c.o = i
c.p = b
c.w = l
c.q = d
d.w = b
d.x = f
h.s = b
h.u = c
h.z = c
e.s = l
e.u = i
e.w = b
i.s = e
i.u = c
i.z = c
f.w = e
f.x = d
b.s = l
b.w = l
b.u = i
assert d.w.s.u.z.q.w.u.z.txt == "
class A:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: D = None
        self.w: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: C = None
        self.txt = txt

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

l = A("l")
c = B("c")
d = C("d")
h = D("h")
e = A("e")
i = D("i")
f = C("f")
b = A("b")

l.s = e
l.w = e
l.u = i
c.o = i
c.p = b
c.w = l
c.q = d
d.w = b
d.x = f
h.s = b
h.u = c
h.z = c
e.s = l
e.u = i
e.w = b
i.s = e
i.u = c
i.z = c
f.w = e
f.x = d
b.s = l
b.w = l
b.u = i
assert d.w.s.u.z.q.w.u.z.txt == "c"