class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.x: E = None
        self.z: H = None
        self.y: F = None
        self.s: B = None
        self.r: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.z: H = None
        self.q: G = None
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.p: G = None
        self.q: A = None
        self.r: B = None
        self.x: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: H = None
        self.w: C = None
        self.v: B = None
        self.y: C = None
        self.txt = txt

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

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

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

g = A("g")
e = B("e")
n = C("n")
d = D("d")
i = E("i")
f = F("f")
h = G("h")
l = H("l")
m = H("m")

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

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.z: H = None
        self.q: G = None
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.p: G = None
        self.q: A = None
        self.r: B = None
        self.x: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: H = None
        self.w: C = None
        self.v: B = None
        self.y: C = None
        self.txt = txt

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

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

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

g = A("g")
e = B("e")
n = C("n")
d = D("d")
i = E("i")
f = F("f")
h = G("h")
l = H("l")
m = H("m")

g.o = f
g.y = f
g.x = i
g.r = i
g.z = l
g.s = e
e.t = h
e.q = h
e.z = m
e.y = n
n.w = i
d.y = l
d.x = l
d.p = h
d.q = g
d.r = e
i.r = l
i.w = n
i.y = n
i.v = e
f.w = h
h.y = g
h.r = e
h.q = d
h.t = m
l.y = f
l.v = h
l.x = e
m.y = f
m.v = h
m.x = e
assert n.w.r.x.y.w.v.t.txt == "h"