class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: D = None
        self.txt = txt

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

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

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

f = A("f")
j = B("j")
k = C("k")
b = D("b")
d = D("d")
a = C("a")
n = C("n")
l = A("l")
i = B("i")

f.v = b
f.q = b
j.w = n
j.z = b
k.q = b
k.o = d
b.x = k
b.y = d
b.p = a
d.x = k
d.y = b
d.p = n
a.q = b
a.o = d
n.q = b
n.o = d
l.v = b
l.q = b
i.w = k
i.z = d
assert n.o.x.q.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: D = None
        self.txt = txt

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

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

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

f = A("f")
j = B("j")
k = C("k")
b = D("b")
d = D("d")
a = C("a")
n = C("n")
l = A("l")
i = B("i")

f.v = b
f.q = b
j.w = n
j.z = b
k.q = b
k.o = d
b.x = k
b.y = d
b.p = a
d.x = k
d.y = b
d.p = n
a.q = b
a.o = d
n.q = b
n.o = d
l.v = b
l.q = b
i.w = k
i.z = d
assert n.o.x.q.txt == "b"