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

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

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

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

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

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

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

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

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