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

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

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

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

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

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

n.v = k
n.t = f
j.u = k
j.y = l
e.u = j
e.y = k
l.u = j
l.y = k
c.u = k
c.y = k
f.v = j
f.t = n
k.u = e
k.y = j
assert l.u.y.u.u.u.y.u.txt == "e"