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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.s: H = None
        self.p: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: G = None
        self.y: C = None
        self.z: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: H = None
        self.s: E = None
        self.v: G = None
        self.r: G = None
        self.u: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.t: D = None
        self.v: E = None
        self.y: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: C = None
        self.w: H = None
        self.o: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: F = None
        self.r: B = None
        self.x: E = None
        self.txt = txt

c = A("c")
g = B("g")
f = C("f")
e = D("e")
h = E("h")
d = F("d")
m = G("m")
l = H("l")
n = C("n")

c.z = l
c.x = n
g.q = m
g.s = l
g.p = c
f.v = m
f.y = n
f.z = l
e.p = l
e.s = h
e.v = m
e.r = m
e.u = d
h.o = m
d.z = f
d.t = e
d.v = h
d.y = m
m.v = f
m.r = f
m.w = l
m.o = d
l.z = d
l.o = d
l.r = g
l.x = h
n.v = m
n.y = f
n.z = l
assert f.z.z.v.o.r.y.v.txt == "
class A:
    def __init__(self, txt: str):
        self.z: H = None
        self.x: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.s: H = None
        self.p: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: G = None
        self.y: C = None
        self.z: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: H = None
        self.s: E = None
        self.v: G = None
        self.r: G = None
        self.u: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.t: D = None
        self.v: E = None
        self.y: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: C = None
        self.w: H = None
        self.o: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: F = None
        self.r: B = None
        self.x: E = None
        self.txt = txt

c = A("c")
g = B("g")
f = C("f")
e = D("e")
h = E("h")
d = F("d")
m = G("m")
l = H("l")
n = C("n")

c.z = l
c.x = n
g.q = m
g.s = l
g.p = c
f.v = m
f.y = n
f.z = l
e.p = l
e.s = h
e.v = m
e.r = m
e.u = d
h.o = m
d.z = f
d.t = e
d.v = h
d.y = m
m.v = f
m.r = f
m.w = l
m.o = d
l.z = d
l.o = d
l.r = g
l.x = h
n.v = m
n.y = f
n.z = l
assert f.z.z.v.o.r.y.v.txt == "m"