class A:
    def __init__(self, txt: str):
        self.x: H = None
        self.t: F = None
        self.u: B = None
        self.v: G = None
        self.w: H = None
        self.o: H = None
        self.z: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.w: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.v: C = None
        self.z: E = None
        self.u: B = None
        self.s: B = None
        self.q: E = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.w: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.v: C = None
        self.z: E = None
        self.u: B = None
        self.s: B = None
        self.q: E = None
        self.txt = txt

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

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

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

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

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

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