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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: D = None
        self.t: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: E = None
        self.x: B = None
        self.q: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: C = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: D = None
        self.t: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: E = None
        self.x: B = None
        self.q: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: C = None
        self.txt = txt

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

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