class A:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: G = None
        self.w: G = None
        self.r: D = None
        self.y: G = None
        self.t: A = None
        self.x: D = None
        self.z: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: C = None
        self.q: H = None
        self.u: G = None
        self.p: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.p: D = None
        self.t: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: A = None
        self.s: B = None
        self.x: B = None
        self.txt = txt

f = A("f")
m = B("m")
j = C("j")
k = D("k")
d = E("d")
a = F("a")
h = G("h")
e = H("e")

f.v = h
m.z = a
m.o = a
m.p = d
j.o = f
j.t = f
j.p = h
j.w = h
j.y = h
j.r = k
j.x = k
j.z = m
k.z = d
d.y = k
d.r = j
d.q = e
d.u = h
d.p = m
a.r = h
a.p = k
a.t = m
h.y = k
h.r = e
h.v = j
e.o = f
e.u = f
e.s = m
e.x = m
assert m.o.t.p.r.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: G = None
        self.w: G = None
        self.r: D = None
        self.y: G = None
        self.t: A = None
        self.x: D = None
        self.z: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: C = None
        self.q: H = None
        self.u: G = None
        self.p: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.p: D = None
        self.t: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: A = None
        self.s: B = None
        self.x: B = None
        self.txt = txt

f = A("f")
m = B("m")
j = C("j")
k = D("k")
d = E("d")
a = F("a")
h = G("h")
e = H("e")

f.v = h
m.z = a
m.o = a
m.p = d
j.o = f
j.t = f
j.p = h
j.w = h
j.y = h
j.r = k
j.x = k
j.z = m
k.z = d
d.y = k
d.r = j
d.q = e
d.u = h
d.p = m
a.r = h
a.p = k
a.t = m
h.y = k
h.r = e
h.v = j
e.o = f
e.u = f
e.s = m
e.x = m
assert m.o.t.p.r.z.z.txt == "a"