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

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

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.t: E = None
        self.z: A = None
        self.u: C = None
        self.x: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: B = None
        self.x: F = None
        self.t: C = None
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.y: A = None
        self.txt = txt

e = A("e")
m = B("m")
g = C("g")
k = D("k")
l = E("l")
f = F("f")
i = G("i")
h = C("h")
a = G("a")

e.x = f
m.w = l
m.t = l
m.u = k
g.r = i
g.t = l
g.z = e
g.u = h
g.x = a
k.v = e
k.z = m
k.x = f
k.t = g
k.w = l
l.z = k
f.x = i
f.u = k
f.t = a
f.r = e
f.z = e
f.v = g
f.y = m
i.q = g
i.y = e
h.r = i
h.t = l
h.z = e
h.u = g
h.x = a
a.q = g
a.y = e
assert g.z.x.t.q.z.txt == "
class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.t: E = None
        self.z: A = None
        self.u: C = None
        self.x: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: B = None
        self.x: F = None
        self.t: C = None
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.y: A = None
        self.txt = txt

e = A("e")
m = B("m")
g = C("g")
k = D("k")
l = E("l")
f = F("f")
i = G("i")
h = C("h")
a = G("a")

e.x = f
m.w = l
m.t = l
m.u = k
g.r = i
g.t = l
g.z = e
g.u = h
g.x = a
k.v = e
k.z = m
k.x = f
k.t = g
k.w = l
l.z = k
f.x = i
f.u = k
f.t = a
f.r = e
f.z = e
f.v = g
f.y = m
i.q = g
i.y = e
h.r = i
h.t = l
h.z = e
h.u = g
h.x = a
a.q = g
a.y = e
assert g.z.x.t.q.z.txt == "e"