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

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

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

f = A("f")
a = B("a")
g = C("g")
e = B("e")
j = A("j")
m = C("m")
i = C("i")
d = B("d")
h = B("h")
n = C("n")

f.w = j
f.v = h
f.o = n
a.v = f
g.p = h
g.t = f
g.z = n
e.v = f
j.w = f
j.v = d
j.o = g
m.p = e
m.t = j
m.z = g
i.p = e
i.t = j
i.z = m
d.v = j
h.v = j
n.p = d
n.t = f
n.z = g
assert g.t.w.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: B = None
        self.o: C = None
        self.txt = txt

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

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

f = A("f")
a = B("a")
g = C("g")
e = B("e")
j = A("j")
m = C("m")
i = C("i")
d = B("d")
h = B("h")
n = C("n")

f.w = j
f.v = h
f.o = n
a.v = f
g.p = h
g.t = f
g.z = n
e.v = f
j.w = f
j.v = d
j.o = g
m.p = e
m.t = j
m.z = g
i.p = e
i.t = j
i.z = m
d.v = j
h.v = j
n.p = d
n.t = f
n.z = g
assert g.t.w.v.v.txt == "j"