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

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

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

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

d = A("d")
l = B("l")
b = C("b")
c = D("c")
k = C("k")
g = C("g")
f = A("f")
a = B("a")
n = C("n")

d.v = f
d.y = a
d.q = c
d.z = c
l.x = a
l.s = c
l.o = c
b.r = a
c.x = d
c.y = l
c.p = a
k.r = a
g.r = a
f.v = d
f.y = l
f.q = c
f.z = c
a.x = l
a.s = c
a.o = c
n.r = a
assert b.r.x.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: B = None
        self.q: D = None
        self.z: D = None
        self.txt = txt

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

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

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

d = A("d")
l = B("l")
b = C("b")
c = D("c")
k = C("k")
g = C("g")
f = A("f")
a = B("a")
n = C("n")

d.v = f
d.y = a
d.q = c
d.z = c
l.x = a
l.s = c
l.o = c
b.r = a
c.x = d
c.y = l
c.p = a
k.r = a
g.r = a
f.v = d
f.y = l
f.q = c
f.z = c
a.x = l
a.s = c
a.o = c
n.r = a
assert b.r.x.x.x.txt == "l"