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

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

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

j = A("j")
n = B("n")
k = C("k")
i = A("i")
d = C("d")
b = B("b")
l = A("l")
m = B("m")

j.v = m
j.r = n
j.u = d
n.y = k
k.t = j
i.v = b
i.r = b
i.u = d
d.t = l
b.y = k
l.v = b
l.r = m
l.u = k
m.y = d
assert m.y.t.u.t.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: B = None
        self.u: C = None
        self.txt = txt

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

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

j = A("j")
n = B("n")
k = C("k")
i = A("i")
d = C("d")
b = B("b")
l = A("l")
m = B("m")

j.v = m
j.r = n
j.u = d
n.y = k
k.t = j
i.v = b
i.r = b
i.u = d
d.t = l
b.y = k
l.v = b
l.r = m
l.u = k
m.y = d
assert m.y.t.u.t.txt == "j"