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

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

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

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

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

k.t = c
d.s = b
d.r = b
d.p = f
d.x = f
b.p = f
b.x = k
c.o = d
c.u = j
i.s = b
i.r = b
i.p = c
i.x = c
l.t = c
j.s = b
j.r = b
j.p = f
j.x = f
f.o = j
f.u = j
n.t = c
assert l.t.o.p.o.s.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

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

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

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

k.t = c
d.s = b
d.r = b
d.p = f
d.x = f
b.p = f
b.x = k
c.o = d
c.u = j
i.s = b
i.r = b
i.p = c
i.x = c
l.t = c
j.s = b
j.r = b
j.p = f
j.x = f
f.o = j
f.u = j
n.t = c
assert l.t.o.p.o.s.txt == "b"