class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: G = None
        self.t: G = None
        self.z: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.y: D = None
        self.z: F = None
        self.p: B = None
        self.q: C = None
        self.o: E = None
        self.txt = txt

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

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.y: D = None
        self.z: F = None
        self.p: B = None
        self.q: C = None
        self.o: E = None
        self.txt = txt

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

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

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

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

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

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

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