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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: C = None
        self.r: G = None
        self.z: C = None
        self.txt = txt

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

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: C = None
        self.r: G = None
        self.z: C = None
        self.txt = txt

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

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

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

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

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