class A:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: A = None
        self.txt = txt

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

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

i = A("i")
e = B("e")
b = C("b")
l = C("l")
k = A("k")
f = B("f")

i.u = k
i.w = k
e.t = l
e.x = f
b.u = k
b.r = i
b.y = e
l.u = k
l.r = k
l.y = f
k.u = i
k.w = i
f.t = b
f.x = e
assert f.x.t.y.txt == "
class A:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: A = None
        self.txt = txt

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

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

i = A("i")
e = B("e")
b = C("b")
l = C("l")
k = A("k")
f = B("f")

i.u = k
i.w = k
e.t = l
e.x = f
b.u = k
b.r = i
b.y = e
l.u = k
l.r = k
l.y = f
k.u = i
k.w = i
f.t = b
f.x = e
assert f.x.t.y.txt == "f"