class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: C = None
        self.t: B = None
        self.z: H = None
        self.w: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: E = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: E = None
        self.txt = txt

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

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

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

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