class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: I = None
        self.x: A = None
        self.y: H = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.y: B = None
        self.q: F = None
        self.p: E = None
        self.s: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.z: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: I = None
        self.p: C = None
        self.o: H = None
        self.z: H = None
        self.v: F = None
        self.r: F = None
        self.y: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: A = None
        self.v: B = None
        self.u: H = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: I = None
        self.x: A = None
        self.y: H = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.y: B = None
        self.q: F = None
        self.p: E = None
        self.s: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.z: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: I = None
        self.p: C = None
        self.o: H = None
        self.z: H = None
        self.v: F = None
        self.r: F = None
        self.y: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: A = None
        self.v: B = None
        self.u: H = None
        self.txt = txt

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

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

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