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

class B:
    def __init__(self, txt: str):
        self.v: H = None
        self.z: C = None
        self.s: G = None
        self.q: C = None
        self.p: E = None
        self.u: A = None
        self.r: A = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.s: D = None
        self.x: G = None
        self.t: E = None
        self.r: B = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.y: F = None
        self.q: D = None
        self.u: D = None
        self.x: C = None
        self.w: A = None
        self.s: G = None
        self.o: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: H = None
        self.z: C = None
        self.s: G = None
        self.q: C = None
        self.p: E = None
        self.u: A = None
        self.r: A = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.s: D = None
        self.x: G = None
        self.t: E = None
        self.r: B = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.y: F = None
        self.q: D = None
        self.u: D = None
        self.x: C = None
        self.w: A = None
        self.s: G = None
        self.o: A = None
        self.txt = txt

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

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