class A:
    def __init__(self, txt: str):
        self.w: A = None
        self.p: A = None
        self.o: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: A = None
        self.txt = txt

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

b.w = l
b.p = l
b.o = c
c.q = j
c.t = j
c.s = l
n.o = k
n.w = b
j.q = c
j.t = c
j.s = l
k.o = n
k.w = b
l.w = b
l.p = b
l.o = j
assert k.w.o.t.txt == "
class A:
    def __init__(self, txt: str):
        self.w: A = None
        self.p: A = None
        self.o: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: A = None
        self.txt = txt

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

b.w = l
b.p = l
b.o = c
c.q = j
c.t = j
c.s = l
n.o = k
n.w = b
j.q = c
j.t = c
j.s = l
k.o = n
k.w = b
l.w = b
l.p = b
l.o = j
assert k.w.o.t.txt == "j"