class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.z: G = None
        self.p: C = None
        self.w: B = None
        self.r: E = None
        self.t: H = None
        self.q: C = None
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.s: D = None
        self.p: D = None
        self.x: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: H = None
        self.w: H = None
        self.t: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: H = None
        self.w: E = None
        self.z: D = None
        self.v: G = None
        self.y: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: H = None
        self.v: B = None
        self.s: C = None
        self.t: H = None
        self.txt = txt

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

m = A("m")
n = B("n")
a = C("a")
g = D("g")
d = E("d")
c = F("c")
f = G("f")
e = H("e")

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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.s: D = None
        self.p: D = None
        self.x: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: H = None
        self.w: H = None
        self.t: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: H = None
        self.w: E = None
        self.z: D = None
        self.v: G = None
        self.y: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: H = None
        self.v: B = None
        self.s: C = None
        self.t: H = None
        self.txt = txt

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

m = A("m")
n = B("n")
a = C("a")
g = D("g")
d = E("d")
c = F("c")
f = G("f")
e = H("e")

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