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

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

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

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: C = None
        self.y: F = None
        self.v: C = None
        self.u: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.v: G = None
        self.y: I = None
        self.z: G = None
        self.r: D = None
        self.s: B = None
        self.q: I = None
        self.x: B = None
        self.o: B = None
        self.p: I = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: J = None
        self.v: I = None
        self.w: E = None
        self.p: I = None
        self.s: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: D = None
        self.y: D = None
        self.txt = txt

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

d = A("d")
m = B("m")
a = C("a")
c = D("c")
g = E("g")
n = F("n")
j = G("j")
l = H("l")
k = I("k")
b = J("b")

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: C = None
        self.y: F = None
        self.v: C = None
        self.u: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.v: G = None
        self.y: I = None
        self.z: G = None
        self.r: D = None
        self.s: B = None
        self.q: I = None
        self.x: B = None
        self.o: B = None
        self.p: I = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: J = None
        self.v: I = None
        self.w: E = None
        self.p: I = None
        self.s: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: D = None
        self.y: D = None
        self.txt = txt

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

d = A("d")
m = B("m")
a = C("a")
c = D("c")
g = E("g")
n = F("n")
j = G("j")
l = H("l")
k = I("k")
b = J("b")

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