class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: B = 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.s: A = None
        self.u: B = None
        self.o: A = None
        self.txt = txt

g = A("g")
j = B("j")
h = C("h")
l = A("l")
k = A("k")
d = B("d")
c = B("c")
n = A("n")
e = C("e")
i = C("i")

g.z = e
g.u = c
j.v = k
h.s = g
h.u = c
h.o = n
l.z = h
l.u = d
k.z = e
k.u = d
d.v = k
c.v = n
n.z = h
n.u = d
e.s = g
e.u = j
e.o = n
i.s = g
i.u = c
i.o = n
assert h.u.v.u.v.u.v.u.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: B = 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.s: A = None
        self.u: B = None
        self.o: A = None
        self.txt = txt

g = A("g")
j = B("j")
h = C("h")
l = A("l")
k = A("k")
d = B("d")
c = B("c")
n = A("n")
e = C("e")
i = C("i")

g.z = e
g.u = c
j.v = k
h.s = g
h.u = c
h.o = n
l.z = h
l.u = d
k.z = e
k.u = d
d.v = k
c.v = n
n.z = h
n.u = d
e.s = g
e.u = j
e.o = n
i.s = g
i.u = c
i.o = n
assert h.u.v.u.v.u.v.u.txt == "d"