class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: F = None
        self.r: A = None
        self.t: G = None
        self.v: H = None
        self.q: F = None
        self.x: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.w: A = None
        self.r: F = None
        self.v: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.r: B = None
        self.y: F = None
        self.q: G = None
        self.z: F = None
        self.s: H = None
        self.u: C = None
        self.w: G = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: F = None
        self.r: A = None
        self.t: G = None
        self.v: H = None
        self.q: F = None
        self.x: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.w: A = None
        self.r: F = None
        self.v: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.r: B = None
        self.y: F = None
        self.q: G = None
        self.z: F = None
        self.s: H = None
        self.u: C = None
        self.w: G = None
        self.txt = txt

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

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

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

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

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