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

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

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

h = A("h")
n = B("n")
g = C("g")
e = C("e")
l = A("l")
j = A("j")
c = C("c")
k = A("k")
a = B("a")
f = B("f")

h.r = a
n.z = k
n.x = l
g.s = f
g.o = a
g.v = l
e.s = a
e.o = a
e.v = l
l.r = f
j.r = f
c.s = a
c.o = f
c.v = k
k.r = a
a.z = j
a.x = h
f.z = k
f.x = l
assert c.v.r.z.r.z.r.x.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

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

h = A("h")
n = B("n")
g = C("g")
e = C("e")
l = A("l")
j = A("j")
c = C("c")
k = A("k")
a = B("a")
f = B("f")

h.r = a
n.z = k
n.x = l
g.s = f
g.o = a
g.v = l
e.s = a
e.o = a
e.v = l
l.r = f
j.r = f
c.s = a
c.o = f
c.v = k
k.r = a
a.z = j
a.x = h
f.z = k
f.x = l
assert c.v.r.z.r.z.r.x.txt == "h"