class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.u: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: H = None
        self.v: E = None
        self.t: F = None
        self.q: E = None
        self.r: A = None
        self.z: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: F = None
        self.y: B = None
        self.q: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: G = None
        self.v: D = None
        self.q: F = None
        self.y: A = None
        self.u: H = None
        self.w: F = None
        self.t: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: A = None
        self.v: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.o: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: H = None
        self.v: E = None
        self.s: B = None
        self.x: E = None
        self.p: B = None
        self.z: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: H = None
        self.v: E = None
        self.t: F = None
        self.q: E = None
        self.r: A = None
        self.z: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: F = None
        self.y: B = None
        self.q: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: G = None
        self.v: D = None
        self.q: F = None
        self.y: A = None
        self.u: H = None
        self.w: F = None
        self.t: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: A = None
        self.v: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.o: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: H = None
        self.v: E = None
        self.s: B = None
        self.x: E = None
        self.p: B = None
        self.z: A = None
        self.txt = txt

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

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