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

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.r: D = None
        self.y: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: I = None
        self.p: I = None
        self.w: F = None
        self.x: A = None
        self.o: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: I = None
        self.z: E = None
        self.w: A = None
        self.t: C = None
        self.s: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: A = None
        self.p: E = None
        self.z: I = None
        self.y: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.r: D = None
        self.y: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: I = None
        self.p: I = None
        self.w: F = None
        self.x: A = None
        self.o: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: I = None
        self.z: E = None
        self.w: A = None
        self.t: C = None
        self.s: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: A = None
        self.p: E = None
        self.z: I = None
        self.y: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

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