class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: I = None
        self.t: G = None
        self.u: G = None
        self.r: D = None
        self.q: F = None
        self.w: B = None
        self.z: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: A = None
        self.q: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.x: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: F = None
        self.x: B = None
        self.z: F = None
        self.q: F = None
        self.u: C = None
        self.r: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: I = None
        self.t: G = None
        self.u: G = None
        self.r: D = None
        self.q: F = None
        self.w: B = None
        self.z: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: A = None
        self.q: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.x: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: F = None
        self.x: B = None
        self.z: F = None
        self.q: F = None
        self.u: C = None
        self.r: E = None
        self.txt = txt

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

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