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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: H = None
        self.w: A = None
        self.s: D = None
        self.t: G = None
        self.o: D = None
        self.y: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: H = None
        self.t: E = None
        self.p: G = None
        self.o: G = None
        self.x: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.w: A = None
        self.q: A = None
        self.x: C = None
        self.v: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: B = None
        self.t: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: H = None
        self.w: A = None
        self.s: D = None
        self.t: G = None
        self.o: D = None
        self.y: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: H = None
        self.t: E = None
        self.p: G = None
        self.o: G = None
        self.x: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.w: A = None
        self.q: A = None
        self.x: C = None
        self.v: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: B = None
        self.t: E = None
        self.txt = txt

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

i.z = c
j.v = h
d.v = h
d.y = h
d.r = c
d.w = i
d.s = e
d.o = e
d.t = m
e.q = c
e.t = h
e.p = m
e.o = m
e.x = m
h.t = e
h.w = i
h.q = i
h.x = d
h.v = c
n.s = j
n.x = m
m.z = h
m.p = n
m.q = d
m.t = e
c.w = i
c.q = j
c.t = h
assert d.v.t.q.t.q.z.txt == "c"