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

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

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

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

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

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

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

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

h.v = i
h.y = i
h.u = i
m.z = h
m.o = a
m.u = g
e.p = h
e.o = c
j.z = c
j.o = d
j.u = g
f.p = c
f.o = c
g.p = h
g.o = c
d.z = h
d.o = a
d.u = f
c.v = i
c.u = i
c.y = m
i.z = h
i.o = j
i.u = e
a.z = c
a.o = d
a.u = f
assert g.p.v.u.p.u.z.y.txt == "i"