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

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

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

e = A("e")
l = B("l")
h = C("h")
g = C("g")
d = C("d")
a = A("a")
j = B("j")
n = A("n")

e.v = g
e.t = h
l.t = e
l.p = a
h.v = g
h.u = g
h.w = l
g.v = d
g.u = h
g.w = l
d.v = g
d.u = h
d.w = l
a.v = g
a.t = d
j.t = n
j.p = n
n.v = d
n.t = g
assert h.w.p.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.t: C = None
        self.txt = txt

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

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

e = A("e")
l = B("l")
h = C("h")
g = C("g")
d = C("d")
a = A("a")
j = B("j")
n = A("n")

e.v = g
e.t = h
l.t = e
l.p = a
h.v = g
h.u = g
h.w = l
g.v = d
g.u = h
g.w = l
d.v = g
d.u = h
d.w = l
a.v = g
a.t = d
j.t = n
j.p = n
n.v = d
n.t = g
assert h.w.p.v.txt == "g"