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

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

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.o: H = None
        self.s: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: F = None
        self.p: B = None
        self.w: H = None
        self.z: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: C = None
        self.s: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: C = None
        self.t: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.o: H = None
        self.s: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: F = None
        self.p: B = None
        self.w: H = None
        self.z: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: C = None
        self.s: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: C = None
        self.t: B = None
        self.txt = txt

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

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