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

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.u: D = None
        self.w: F = None
        self.y: G = None
        self.p: A = None
        self.z: C = None
        self.q: A = None
        self.txt = txt

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

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

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

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

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

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

m = A("m")
c = B("c")
h = C("h")
g = D("g")
a = E("a")
j = F("j")
i = G("i")
b = H("b")
l = G("l")

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

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.u: D = None
        self.w: F = None
        self.y: G = None
        self.p: A = None
        self.z: C = None
        self.q: A = None
        self.txt = txt

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

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

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

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

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

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

m = A("m")
c = B("c")
h = C("h")
g = D("g")
a = E("a")
j = F("j")
i = G("i")
b = H("b")
l = G("l")

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