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

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

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

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

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

a.u = i
a.x = l
i.y = k
k.x = l
k.w = l
k.r = b
k.v = i
j.v = a
j.o = a
j.z = a
j.p = a
l.x = k
l.w = k
l.r = i
l.v = b
b.y = l
assert b.y.r.y.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: C = None
        self.txt = txt

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

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

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

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

a.u = i
a.x = l
i.y = k
k.x = l
k.w = l
k.r = b
k.v = i
j.v = a
j.o = a
j.z = a
j.p = a
l.x = k
l.w = k
l.r = i
l.v = b
b.y = l
assert b.y.r.y.txt == "k"