class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: D = None
        self.y: I = None
        self.v: F = None
        self.u: E = None
        self.x: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.v: D = None
        self.z: H = None
        self.s: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.t: G = None
        self.s: F = None
        self.p: B = None
        self.z: E = None
        self.txt = txt

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

c = A("c")
e = B("e")
g = C("g")
h = D("h")
l = E("l")
j = F("j")
i = G("i")
f = H("f")
k = I("k")
m = E("m")

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

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.v: D = None
        self.z: H = None
        self.s: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.t: G = None
        self.s: F = None
        self.p: B = None
        self.z: E = None
        self.txt = txt

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

c = A("c")
e = B("e")
g = C("g")
h = D("h")
l = E("l")
j = F("j")
i = G("i")
f = H("f")
k = I("k")
m = E("m")

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