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

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

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

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

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

b.p = n
b.s = n
b.u = a
b.o = a
l.o = a
l.z = a
l.s = j
l.t = b
n.x = a
n.w = j
a.q = j
j.o = a
j.z = a
j.s = l
j.t = k
k.p = n
k.s = n
k.u = a
k.o = a
assert b.o.q.s.t.o.q.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: D = None
        self.o: D = None
        self.s: C = None
        self.txt = txt

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

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

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

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

b.p = n
b.s = n
b.u = a
b.o = a
l.o = a
l.z = a
l.s = j
l.t = b
n.x = a
n.w = j
a.q = j
j.o = a
j.z = a
j.s = l
j.t = k
k.p = n
k.s = n
k.u = a
k.o = a
assert b.o.q.s.t.o.q.txt == "j"