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

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

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.r: C = None
        self.x: G = None
        self.z: E = None
        self.v: B = None
        self.u: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.q: D = None
        self.r: A = None
        self.z: D = None
        self.t: G = None
        self.x: B = None
        self.v: A = None
        self.w: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: H = None
        self.o: D = None
        self.x: C = None
        self.y: E = None
        self.p: G = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.r: C = None
        self.x: G = None
        self.z: E = None
        self.v: B = None
        self.u: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.q: D = None
        self.r: A = None
        self.z: D = None
        self.t: G = None
        self.x: B = None
        self.v: A = None
        self.w: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: H = None
        self.o: D = None
        self.x: C = None
        self.y: E = None
        self.p: G = None
        self.txt = txt

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

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

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

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