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

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

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

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

m = A("m")
d = B("d")
l = C("l")
b = D("b")
j = B("j")
i = D("i")
n = A("n")
g = D("g")
f = B("f")
h = B("h")

m.y = h
m.o = i
m.u = g
m.w = n
d.s = l
l.s = m
b.z = d
b.q = n
b.w = l
b.p = h
j.s = l
i.z = j
i.q = m
i.w = l
i.p = h
n.y = f
n.o = i
n.u = i
n.w = m
g.z = f
g.p = f
g.q = n
g.w = l
f.s = l
h.s = l
assert d.s.s.y.s.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: D = None
        self.u: D = None
        self.w: A = None
        self.txt = txt

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

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

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

m = A("m")
d = B("d")
l = C("l")
b = D("b")
j = B("j")
i = D("i")
n = A("n")
g = D("g")
f = B("f")
h = B("h")

m.y = h
m.o = i
m.u = g
m.w = n
d.s = l
l.s = m
b.z = d
b.q = n
b.w = l
b.p = h
j.s = l
i.z = j
i.q = m
i.w = l
i.p = h
n.y = f
n.o = i
n.u = i
n.w = m
g.z = f
g.p = f
g.q = n
g.w = l
f.s = l
h.s = l
assert d.s.s.y.s.txt == "l"