class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.q: B = None
        self.x: C = None
        self.w: G = None
        self.t: G = None
        self.s: C = None
        self.p: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: A = None
        self.w: H = None
        self.s: I = None
        self.o: B = None
        self.v: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: B = None
        self.x: F = None
        self.p: B = None
        self.y: E = None
        self.o: B = None
        self.u: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.y: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: A = None
        self.w: H = None
        self.s: I = None
        self.o: B = None
        self.v: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: B = None
        self.x: F = None
        self.p: B = None
        self.y: E = None
        self.o: B = None
        self.u: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.y: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

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

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