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

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

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

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

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

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

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

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

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

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

l.x = c
l.v = c
l.p = b
l.s = a
d.t = l
d.z = c
d.p = c
a.x = k
a.r = c
a.u = b
a.o = l
b.t = k
k.x = a
k.r = c
k.u = b
k.o = l
c.x = a
c.r = a
c.u = b
c.o = l
assert k.o.s.r.o.s.u.txt == "b"