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

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

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

i = A("i")
c = B("c")
a = C("a")
e = B("e")
k = C("k")
f = C("f")
h = A("h")

i.w = a
c.x = e
c.t = a
c.z = f
a.z = f
a.t = e
a.x = h
e.x = c
e.t = a
e.z = f
k.z = a
k.t = c
k.x = i
f.z = a
f.t = e
f.x = h
h.w = a
assert h.w.z.z.z.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

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

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

i = A("i")
c = B("c")
a = C("a")
e = B("e")
k = C("k")
f = C("f")
h = A("h")

i.w = a
c.x = e
c.t = a
c.z = f
a.z = f
a.t = e
a.x = h
e.x = c
e.t = a
e.z = f
k.z = a
k.t = c
k.x = i
f.z = a
f.t = e
f.x = h
h.w = a
assert h.w.z.z.z.t.t.txt == "a"