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

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.p: H = None
        self.s: H = None
        self.o: H = None
        self.t: H = None
        self.q: D = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: G = None
        self.z: B = None
        self.w: H = None
        self.o: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: G = None
        self.y: B = None
        self.x: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: B = None
        self.s: G = None
        self.q: B = None
        self.z: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: B = None
        self.y: C = None
        self.p: E = None
        self.v: A = None
        self.x: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: C = None
        self.u: H = None
        self.x: H = None
        self.q: D = None
        self.z: C = None
        self.w: H = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.p: H = None
        self.s: H = None
        self.o: H = None
        self.t: H = None
        self.q: D = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: G = None
        self.z: B = None
        self.w: H = None
        self.o: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: G = None
        self.y: B = None
        self.x: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: B = None
        self.s: G = None
        self.q: B = None
        self.z: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: B = None
        self.y: C = None
        self.p: E = None
        self.v: A = None
        self.x: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: C = None
        self.u: H = None
        self.x: H = None
        self.q: D = None
        self.z: C = None
        self.w: H = None
        self.txt = txt

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

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

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