class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.s: C = None
        self.v: B = None
        self.t: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: C = None
        self.s: E = None
        self.v: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: A = None
        self.txt = txt

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

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

m = A("m")
j = B("j")
c = C("c")
h = D("h")
d = E("d")
i = F("i")
a = G("a")
g = H("g")

m.z = i
m.s = c
m.v = j
m.t = h
j.v = h
j.p = a
c.y = m
h.z = c
h.x = c
h.s = d
h.v = m
d.r = h
d.p = h
d.y = g
d.v = a
d.t = a
d.z = i
d.s = i
d.u = m
i.y = d
i.o = m
a.r = h
g.x = j
assert d.r.z.y.t.x.y.s.txt == "
class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.s: C = None
        self.v: B = None
        self.t: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: C = None
        self.s: E = None
        self.v: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: A = None
        self.txt = txt

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

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

m = A("m")
j = B("j")
c = C("c")
h = D("h")
d = E("d")
i = F("i")
a = G("a")
g = H("g")

m.z = i
m.s = c
m.v = j
m.t = h
j.v = h
j.p = a
c.y = m
h.z = c
h.x = c
h.s = d
h.v = m
d.r = h
d.p = h
d.y = g
d.v = a
d.t = a
d.z = i
d.s = i
d.u = m
i.y = d
i.o = m
a.r = h
g.x = j
assert d.r.z.y.t.x.y.s.txt == "c"