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

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

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

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

n.s = b
n.t = a
b.p = e
b.y = k
l.p = n
l.y = k
e.p = k
e.y = n
a.p = n
a.y = k
d.p = e
d.y = k
k.s = b
k.t = e
j.p = k
j.y = k
assert b.y.t.y.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.t: C = None
        self.txt = txt

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

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

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

n.s = b
n.t = a
b.p = e
b.y = k
l.p = n
l.y = k
e.p = k
e.y = n
a.p = n
a.y = k
d.p = e
d.y = k
k.s = b
k.t = e
j.p = k
j.y = k
assert b.y.t.y.s.txt == "b"