class A:
    def __init__(self, txt: str):
        self.u: G = None
        self.p: D = None
        self.z: F = None
        self.v: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: E = None
        self.x: C = None
        self.o: H = None
        self.r: E = None
        self.s: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.z: A = None
        self.q: E = None
        self.w: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: D = None
        self.y: H = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: E = None
        self.x: C = None
        self.o: H = None
        self.r: E = None
        self.s: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.z: A = None
        self.q: E = None
        self.w: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: D = None
        self.y: H = None
        self.txt = txt

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

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

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

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