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

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

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

l = A("l")
c = B("c")
n = C("n")
h = B("h")
d = A("d")
j = B("j")
f = A("f")
g = B("g")
m = B("m")
b = A("b")

l.v = d
l.t = c
l.w = h
c.o = h
n.p = b
h.o = c
d.v = b
d.t = g
d.w = j
j.o = g
f.v = d
f.t = j
f.w = j
g.o = h
m.o = g
b.v = l
b.t = c
b.w = j
assert h.o.o.o.o.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.v: A = None
        self.t: B = None
        self.w: B = None
        self.txt = txt

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

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

l = A("l")
c = B("c")
n = C("n")
h = B("h")
d = A("d")
j = B("j")
f = A("f")
g = B("g")
m = B("m")
b = A("b")

l.v = d
l.t = c
l.w = h
c.o = h
n.p = b
h.o = c
d.v = b
d.t = g
d.w = j
j.o = g
f.v = d
f.t = j
f.w = j
g.o = h
m.o = g
b.v = l
b.t = c
b.w = j
assert h.o.o.o.o.o.o.txt == "h"