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

class B:
    def __init__(self, txt: str):
        self.o: H = None
        self.v: H = None
        self.p: D = None
        self.z: C = None
        self.x: D = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: D = None
        self.p: F = None
        self.s: A = None
        self.r: D = None
        self.w: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.p: G = None
        self.y: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: G = None
        self.q: E = None
        self.s: D = None
        self.w: G = None
        self.z: F = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: H = None
        self.v: H = None
        self.p: D = None
        self.z: C = None
        self.x: D = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: D = None
        self.p: F = None
        self.s: A = None
        self.r: D = None
        self.w: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.p: G = None
        self.y: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: G = None
        self.q: E = None
        self.s: D = None
        self.w: G = None
        self.z: F = None
        self.txt = txt

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

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

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

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