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

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

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

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

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

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

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

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

j.v = n
j.z = a
j.o = c
a.p = g
a.r = n
a.w = n
h.u = f
h.s = a
h.r = c
i.u = c
i.s = a
i.r = g
f.v = n
f.z = n
f.o = j
c.v = a
c.z = a
c.o = f
m.u = c
m.s = n
m.r = j
n.p = j
n.r = a
n.w = a
g.v = a
g.z = n
g.o = j
assert m.u.o.v.p.v.r.p.v.txt == "a"