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

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

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

j = A("j")
a = B("a")
b = C("b")
g = B("g")
f = C("f")
l = B("l")
e = B("e")

j.y = f
j.t = l
j.s = l
a.x = j
b.t = f
b.s = j
b.x = j
g.x = j
f.t = b
f.s = j
f.x = j
l.x = j
e.x = j
assert e.x.y.s.t.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: B = None
        self.s: B = None
        self.txt = txt

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

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

j = A("j")
a = B("a")
b = C("b")
g = B("g")
f = C("f")
l = B("l")
e = B("e")

j.y = f
j.t = l
j.s = l
a.x = j
b.t = f
b.s = j
b.x = j
g.x = j
f.t = b
f.s = j
f.x = j
l.x = j
e.x = j
assert e.x.y.s.t.txt == "l"