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

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

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.x: E = None
        self.p: H = None
        self.w: E = None
        self.q: A = None
        self.o: G = None
        self.y: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.q: E = None
        self.u: F = None
        self.s: F = None
        self.o: H = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.t: B = None
        self.q: B = None
        self.y: A = None
        self.p: D = None
        self.s: D = None
        self.u: D = None
        self.z: F = None
        self.r: D = None
        self.txt = txt

a = A("a")
n = B("n")
d = C("d")
l = D("l")
f = E("f")
e = F("e")
c = G("c")
m = H("m")

a.p = m
a.v = n
a.t = f
a.x = f
a.w = c
n.v = a
n.p = d
n.w = m
d.u = f
d.x = f
d.w = f
d.p = m
d.y = m
d.q = a
d.o = c
l.y = m
l.o = m
l.q = f
l.u = e
l.s = e
f.z = n
f.p = d
e.v = n
e.p = n
c.t = a
c.y = e
c.w = e
c.u = d
c.s = n
c.v = f
c.z = f
c.o = m
m.t = n
m.q = n
m.y = a
m.p = l
m.s = l
m.u = l
m.r = l
m.z = e
assert c.u.o.t.x.z.w.t.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: H = None
        self.v: B = None
        self.t: E = None
        self.w: G = None
        self.x: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.x: E = None
        self.p: H = None
        self.w: E = None
        self.q: A = None
        self.o: G = None
        self.y: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.q: E = None
        self.u: F = None
        self.s: F = None
        self.o: H = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.t: B = None
        self.q: B = None
        self.y: A = None
        self.p: D = None
        self.s: D = None
        self.u: D = None
        self.z: F = None
        self.r: D = None
        self.txt = txt

a = A("a")
n = B("n")
d = C("d")
l = D("l")
f = E("f")
e = F("e")
c = G("c")
m = H("m")

a.p = m
a.v = n
a.t = f
a.x = f
a.w = c
n.v = a
n.p = d
n.w = m
d.u = f
d.x = f
d.w = f
d.p = m
d.y = m
d.q = a
d.o = c
l.y = m
l.o = m
l.q = f
l.u = e
l.s = e
f.z = n
f.p = d
e.v = n
e.p = n
c.t = a
c.y = e
c.w = e
c.u = d
c.s = n
c.v = f
c.z = f
c.o = m
m.t = n
m.q = n
m.y = a
m.p = l
m.s = l
m.u = l
m.r = l
m.z = e
assert c.u.o.t.x.z.w.t.p.txt == "d"