class A:
    def __init__(self, txt: str):
        self.s: H = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: A = None
        self.r: E = None
        self.w: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: B = None
        self.q: D = None
        self.u: E = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: A = None
        self.r: E = None
        self.w: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: B = None
        self.q: D = None
        self.u: E = None
        self.txt = txt

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

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

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

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