class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: D = None
        self.txt = txt

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

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

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

b = A("b")
l = B("l")
j = C("j")
c = D("c")
a = B("a")
k = C("k")
e = D("e")

b.t = e
b.o = c
l.v = k
l.y = a
j.r = k
c.x = b
c.z = j
c.p = l
c.s = a
a.v = k
a.y = l
k.r = j
e.x = b
e.z = j
e.p = l
e.s = l
assert b.t.s.y.y.y.v.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: D = None
        self.txt = txt

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

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

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

b = A("b")
l = B("l")
j = C("j")
c = D("c")
a = B("a")
k = C("k")
e = D("e")

b.t = e
b.o = c
l.v = k
l.y = a
j.r = k
c.x = b
c.z = j
c.p = l
c.s = a
a.v = k
a.y = l
k.r = j
e.x = b
e.z = j
e.p = l
e.s = l
assert b.t.s.y.y.y.v.txt == "k"