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

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

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

n.y = c
c.t = b
b.y = c
l.t = n
k.y = c
m.t = n
e.t = k
j.t = b
assert k.y.t.y.t.y.t.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

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

n.y = c
c.t = b
b.y = c
l.t = n
k.y = c
m.t = n
e.t = k
j.t = b
assert k.y.t.y.t.y.t.y.txt == "c"