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

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

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

i = A("i")
m = B("m")
a = C("a")
f = A("f")
j = C("j")
c = C("c")

i.w = f
i.t = m
i.v = m
m.x = f
m.u = f
m.y = c
a.w = i
a.t = m
a.y = m
f.w = i
f.t = m
f.v = m
j.w = f
j.t = m
j.y = m
c.w = i
c.t = m
c.y = m
assert m.u.v.y.t.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: B = None
        self.v: B = None
        self.txt = txt

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

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

i = A("i")
m = B("m")
a = C("a")
f = A("f")
j = C("j")
c = C("c")

i.w = f
i.t = m
i.v = m
m.x = f
m.u = f
m.y = c
a.w = i
a.t = m
a.y = m
f.w = i
f.t = m
f.v = m
j.w = f
j.t = m
j.y = m
c.w = i
c.t = m
c.y = m
assert m.u.v.y.t.u.txt == "f"