class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: D = None
        self.o: C = None
        self.w: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: C = None
        self.x: B = None
        self.u: C = None
        self.txt = txt

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

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

i.z = n
i.o = n
i.r = c
i.w = m
l.x = n
n.q = e
n.u = e
n.x = l
c.p = g
c.s = m
j.q = n
j.x = g
j.u = e
g.x = e
e.q = j
e.u = j
e.x = b
b.x = n
m.p = b
m.s = c
k.x = j
assert k.x.q.u.q.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: D = None
        self.o: C = None
        self.w: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: C = None
        self.x: B = None
        self.u: C = None
        self.txt = txt

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

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

i.z = n
i.o = n
i.r = c
i.w = m
l.x = n
n.q = e
n.u = e
n.x = l
c.p = g
c.s = m
j.q = n
j.x = g
j.u = e
g.x = e
e.q = j
e.u = j
e.x = b
b.x = n
m.p = b
m.s = c
k.x = j
assert k.x.q.u.q.txt == "j"