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

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

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

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

f.w = g
l.o = a
l.t = a
l.v = a
i.w = f
i.o = a
i.x = e
c.w = f
c.o = l
c.x = e
e.w = f
e.o = g
e.x = i
a.o = l
a.v = l
a.t = g
g.o = a
g.v = a
g.t = l
h.w = f
h.o = l
h.x = e
assert c.o.v.t.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

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

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

f.w = g
l.o = a
l.t = a
l.v = a
i.w = f
i.o = a
i.x = e
c.w = f
c.o = l
c.x = e
e.w = f
e.o = g
e.x = i
a.o = l
a.v = l
a.t = g
g.o = a
g.v = a
g.t = l
h.w = f
h.o = l
h.x = e
assert c.o.v.t.txt == "g"