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

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

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

j = A("j")
n = B("n")
e = C("e")
a = C("a")

j.t = a
j.y = a
n.v = j
e.x = j
e.t = a
a.x = j
a.t = e
assert e.x.y.x.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: C = None
        self.txt = txt

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

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

j = A("j")
n = B("n")
e = C("e")
a = C("a")

j.t = a
j.y = a
n.v = j
e.x = j
e.t = a
a.x = j
a.t = e
assert e.x.y.x.txt == "j"