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

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: G = None
        self.p: A = None
        self.x: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: A = None
        self.x: D = None
        self.v: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: B = None
        self.q: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: B = None
        self.z: G = None
        self.txt = txt

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

m.o = d
m.q = i
m.y = i
m.w = h
b.u = k
b.s = e
b.p = m
b.x = i
h.z = n
h.w = m
h.x = i
h.v = e
i.z = h
i.s = b
n.s = k
n.z = m
n.p = e
n.v = i
k.y = i
k.u = b
k.q = n
e.z = k
e.o = n
d.p = b
d.z = e
g.u = k
g.s = e
g.p = m
g.x = i
assert i.s.s.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: H = None
        self.q: D = None
        self.w: C = None
        self.y: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: G = None
        self.p: A = None
        self.x: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: A = None
        self.x: D = None
        self.v: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: B = None
        self.q: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: B = None
        self.z: G = None
        self.txt = txt

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

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