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

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

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

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.u: E = None
        self.q: G = None
        self.y: A = None
        self.p: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: I = None
        self.s: C = None
        self.u: C = None
        self.q: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.x: H = None
        self.w: E = None
        self.r: C = None
        self.z: B = None
        self.q: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.u: E = None
        self.q: G = None
        self.y: A = None
        self.p: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: I = None
        self.s: C = None
        self.u: C = None
        self.q: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.x: H = None
        self.w: E = None
        self.r: C = None
        self.z: B = None
        self.q: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

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

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

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