class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.z: E = None
        self.v: B = None
        self.s: E = None
        self.p: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: F = None
        self.z: G = None
        self.r: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.r: F = None
        self.t: D = None
        self.u: C = None
        self.q: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: F = None
        self.p: E = None
        self.x: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: B = None
        self.x: F = None
        self.t: E = None
        self.s: F = None
        self.txt = txt

d = A("d")
h = B("h")
f = C("f")
b = D("b")
k = E("k")
m = F("m")
i = G("i")
c = H("c")
e = E("e")

d.y = h
d.v = h
d.z = e
d.s = e
d.p = e
h.s = c
h.r = m
h.v = b
h.p = k
f.t = m
b.q = f
b.s = m
b.z = i
b.r = i
k.s = i
k.r = m
k.t = b
k.u = f
k.q = d
m.v = f
i.u = e
i.p = e
i.w = m
i.x = h
c.p = h
c.v = h
c.x = m
c.s = m
c.t = e
e.s = i
e.r = m
e.t = b
e.u = f
e.q = d
assert e.u.t.v.t.v.t.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.z: E = None
        self.v: B = None
        self.s: E = None
        self.p: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: F = None
        self.z: G = None
        self.r: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.r: F = None
        self.t: D = None
        self.u: C = None
        self.q: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: F = None
        self.p: E = None
        self.x: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: B = None
        self.x: F = None
        self.t: E = None
        self.s: F = None
        self.txt = txt

d = A("d")
h = B("h")
f = C("f")
b = D("b")
k = E("k")
m = F("m")
i = G("i")
c = H("c")
e = E("e")

d.y = h
d.v = h
d.z = e
d.s = e
d.p = e
h.s = c
h.r = m
h.v = b
h.p = k
f.t = m
b.q = f
b.s = m
b.z = i
b.r = i
k.s = i
k.r = m
k.t = b
k.u = f
k.q = d
m.v = f
i.u = e
i.p = e
i.w = m
i.x = h
c.p = h
c.v = h
c.x = m
c.s = m
c.t = e
e.s = i
e.r = m
e.t = b
e.u = f
e.q = d
assert e.u.t.v.t.v.t.txt == "m"