class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.r: H = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: F = None
        self.s: G = None
        self.r: F = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: G = None
        self.y: G = None
        self.o: E = None
        self.txt = txt

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

m.u = k
m.r = n
g.o = n
g.u = i
g.s = i
g.q = f
g.w = h
g.y = k
i.y = n
h.x = k
h.o = k
h.r = k
h.s = f
a.w = e
k.q = m
k.p = m
k.v = i
k.x = i
k.s = h
f.w = h
f.r = k
f.t = n
n.r = k
n.v = f
n.y = f
n.o = a
e.w = a
assert e.w.w.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.r: H = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: F = None
        self.s: G = None
        self.r: F = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: G = None
        self.y: G = None
        self.o: E = None
        self.txt = txt

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

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