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

class B:
    def __init__(self, txt: str):
        self.r: H = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: D = None
        self.r: D = None
        self.s: D = None
        self.u: E = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.t: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.u: F = None
        self.t: A = None
        self.w: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: H = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: D = None
        self.r: D = None
        self.s: D = None
        self.u: E = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.t: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.u: F = None
        self.t: A = None
        self.w: F = None
        self.txt = txt

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

e.y = h
e.x = k
e.w = k
e.s = l
h.r = m
h.o = a
k.z = n
k.x = g
k.r = g
k.s = g
k.u = a
g.x = h
g.s = h
g.y = n
a.t = m
n.q = h
n.x = a
n.z = e
l.s = k
l.t = a
m.q = a
m.u = n
m.w = n
m.t = e
assert n.z.y.r.q.t.u.z.x.txt == "k"